You can use a function like this to do the conversion:

function toDegrees (angle) {
  return angle * (180 / Math.PI);
}

Note that functions like sin, cos, and so on do not return angles, they take angles as input. It seems to me that it would be more useful to you to have a function that converts a degree input to radians, like this:

function toRadians (angle) {
  return angle * (Math.PI / 180);
}

which you could use to do something like tan(toRadians(45)).

Answer from Peter Olson on Stack Overflow
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Math โ€บ sin
Math.sin() - JavaScript | MDN - Mozilla
December 29, 2025 - function getCircleY(radians, radius) { return Math.sin(radians) * radius; } console.log(getCircleY(1, 10)); // Expected output: 8.414709848078965 console.log(getCircleY(2, 10)); // Expected output: 9.092974268256818 console.log(getCircleY(Math.PI, 10)); // Expected output: 1.2246467991473533e-15
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_sin.asp
JavaScript Math sin() Method
Math.sin(x) expect x in radians. To use degrees, convert degrees to radians first.
People also ask

Can I use Math.sin with degrees?
No, Math.sin only works with radians. You must convert degrees to radians first. Multiply the degree value by ฯ€ and divide by 180 to get the right input.
๐ŸŒ
flatcoding.com
flatcoding.com โ€บ home โ€บ javascript math sin function with syntax and uses
JavaScript Math sin Function with Syntax and Uses - FlatCoding
What does Math.sin return in JavaScript?
Math.sin returns the sine of a number. The input must be in radians. The return value stays between -1 and 1. This lets you work with angles and trigonometry.
๐ŸŒ
flatcoding.com
flatcoding.com โ€บ home โ€บ javascript math sin function with syntax and uses
JavaScript Math sin Function with Syntax and Uses - FlatCoding
Why does Math.sin(Math.PI) not return exactly 0?
It does not return 0 because of floating-point limits. The result may be a very small number close to 0. This happens with many math methods in JavaScript.
๐ŸŒ
flatcoding.com
flatcoding.com โ€บ home โ€บ javascript math sin function with syntax and uses
JavaScript Math sin Function with Syntax and Uses - FlatCoding
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_math.asp
JavaScript Math Object
Math.pow(x, y) returns the value ... degrees instead of radians, you have to convert degrees to radians: Angle in radians = Angle in degrees x PI / 180....
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ javascript โ€บ standard-library โ€บ Math โ€บ sin
JavaScript Math sin() - Calculate Sine Value | Vultr Docs
September 27, 2024 - This code converts 90 degrees to radians and calculates its sine, which famously results in 1. Embed Math.sin() within a custom function to compute sine for various angles.
๐ŸŒ
Math.js
mathjs.org โ€บ docs โ€บ reference โ€บ functions โ€บ sin.html
math.js | an extensive math library for JavaScript and Node.js
To avoid confusion with the matrix sine, this function does not apply to matrices. ... math.sin(2) // returns number 0.9092974268256813 math.sin(math.pi / 4) // returns number 0.7071067811865475 math.sin(math.unit(90, 'deg')) // returns number 1 math.sin(math.unit(30, 'deg')) // returns number 0.5 const angle = 0.2 math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number 1
Find elsewhere
๐ŸŒ
TechOnTheNet
techonthenet.com โ€บ js โ€บ math_sin.php
JavaScript: Math sin() function
In JavaScript, the syntax for the sin() function is: ... The number used to calculate the sine. It is the value of an angle expressed in radians. The sin() function returns the sine of a number. To convert degrees to radians, multiply by 2ฯ€/360 or 0.017453293.
๐ŸŒ
Dirask
dirask.com โ€บ posts โ€บ JavaScript-Math-sin-in-degrees-Z1AwNp
JavaScript - Math.sin in degrees
// ONLINE-RUNNER:browser; function calculateSine(degrees) { var radians = (Math.PI / 180) * degrees; return Math.sin(radians); } // Example: console.log( calculateSine(0) ); // 0 console.log( calculateSine(30) ); // ~0.5 console.log( ...
๐ŸŒ
FlatCoding
flatcoding.com โ€บ home โ€บ javascript math sin function with syntax and uses
JavaScript Math sin Function with Syntax and Uses - FlatCoding
June 27, 2025 - This line sets result to the sine of ฯ€ divided by 2. JavaScript converts ฯ€/2 into a radian angle. Then it returns the sine of that angle. The final result is 1. This shows how to work with radians and get the expected output from the method. It runs from the Math object without extra steps. ... This example converts 90 degrees ...
๐ŸŒ
Programiz
programiz.com โ€บ javascript โ€บ library โ€บ math โ€บ sin
JavaScript Math sin()
// negative angles are allowed let value2 = Math.sin(-2); console.log(value2); // Output: // -0.9589242746631385 // -0.9092974268256817 ... // math constants can be used let value = Math.sin(Math.PI); console.log(value); // Output: 1.2246467991473532e-16
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ what-is-mathsin-in-javascript
What is Math.sin() in JavaScript?
Number in JavaScript is a 64-bit double-precision value which is the same as double in C# or Java. Number: It returns the sine of the given angle stored in param. It is of Number type.
๐ŸŒ
Dirask
dirask.com โ€บ posts โ€บ JavaScript-Math-sin-method-example-3D78np
JavaScript - Math.sin() method example
// ONLINE-RUNNER:browser; function calculateSin(degrees) { var radians = (Math.PI / 180) * degrees; return Math.sin(radians); } // Example: var x1 = 0.0; // beginning of calculation in degrees var x2 = 90.0; // ending of calculation degrees ...
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Math
Math - JavaScript - MDN Web Docs
Math.trunc() Returns the integer portion of the input, removing any fractional digits. The trigonometric functions sin(), cos(), tan(), asin(), acos(), atan(), and atan2() expect (and return) angles in radians. Since humans tend to think in degrees, and some functions (such as CSS transforms) can accept degrees, it is a good idea to keep functions handy that convert between the two: js ยท
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript-math-sin-method
JavaScript Math sin() Method | GeeksforGeeks
July 15, 2024 - The JavaScript Math sin( ) method in Javascript is used to return the sine of a number. The Math.sin() method returns a numeric value between -1 and 1, which represents the sine of the angle given in radians.
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_cos.asp
JavaScript Math cos() Method
The Math.cos() method returns a number between -1 and 1. The Math.cos() method expects the number in radians. Radians is an angle's ฮฑ amount of rotation b on a circle: The Math.sin() Method The Math.sinh() Method The Math.asin() Method The ...
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ tryit.asp
W3Schools Tryit Editor - JavaScript Math.sin()
The W3Schools online code editor allows you to edit code and view the result in your browser
๐ŸŒ
p5.js
p5js.org โ€บ reference โ€บ p5 โ€บ sin
sin
The values returned oscillate between -1 and 1 as the input angle increases. sin() calculates the sine of an angle, using radians by default, or according to if angleMode() setting (RADIANS or DEGREES).
๐ŸŒ
O'Reilly
oreilly.com โ€บ library โ€บ view โ€บ javascript-the-definitive โ€บ 0596000480 โ€บ re115.html
Math.sin( ) - JavaScript: The Definitive Guide, Fourth Edition [Book]
Name Math.sin( ) โ€” compute a sine Availability JavaScript 1.0; JScript 1.0; ECMAScript v1 Synopsis Math.sin(x) Arguments x An angle, in radians. To convert degrees to radians, multiply โ€ฆ - Selection from JavaScript: The Definitive Guide, Fourth Edition [Book]