---
warning: This file is auto generated by `yarn web:inject`, do not edit by hand
examples:
- sin(0)
- sin(1.5707963267948966)
- sin(-1.5707963267948966)
returns:
- '0'
- '1'
- '-1'
dependencies: []
authors:
original by:
- Kevin van Zonneveld (https://kvz.io)
notes:
- Returns the sine of x, where x is in radians
parityVerified:
- Python 3.12
isTypescript: true
type: function
layout: function
title: Python's math.sin in TypeScript
description: >-
Here's what our current TypeScript equivalent to Python's
math.sin looks like.
function: sin
category: math
language: python
permalink: python/math/sin/
alias:
- /functions/python/sin/
- /functions/math/sin/
- /python/sin/
---
{% codeblock lang:typescript %}export function sin(x: number): number {
// discuss at: https://locutus.io/python/sin/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Returns the sine of x, where x is in radians
// example 1: sin(0)
// returns 1: 0
// example 2: sin(1.5707963267948966)
// returns 2: 1
// example 3: sin(-1.5707963267948966)
// returns 3: -1
return Math.sin(x)
}
{% endcodeblock %}
{% codeblock lang:javascript %}export function sin(x) {
// discuss at: https://locutus.io/python/sin/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Returns the sine of x, where x is in radians
// example 1: sin(0)
// returns 1: 0
// example 2: sin(1.5707963267948966)
// returns 2: 1
// example 3: sin(-1.5707963267948966)
// returns 3: -1
return Math.sin(x)
}{% endcodeblock %}