Trigonometry
suggest changeAll angles below are in radians. An angle r in radians has measure 180 * r / Math.PI in degrees.
Sine
Math.sin(r);
This will return the sine of r, a value between -1 and 1.
Math.asin(r);
This will return the arcsine of r, from -π/2 to π/2. Outside [-1, 1] the result is NaN.
Math.asinh(r)
This will return the hyperbolic arcsine of r.
Cosine
Math.cos(r);
This will return the cosine of r, a value between -1 and 1
Math.acos(r);
This will return the arccosine of r, from 0 to π. Outside [-1, 1] the result is NaN.
Math.acosh(r);
This will return the hyperbolic arccosine of r. If r < 1, the result is NaN.
Tangent
Math.tan(r);
This will return the tangent of r.
Math.atan(r);
This will return the arctangent (the reverse of the tangent) of r. Note that it will return an angle in radians between -π/2 and π/2.
Math.atanh(r);
This will return the hyperbolic arctangent of r. The result is finite only for r strictly between -1 and 1. Math.atanh(1) is Infinity.
Math.atan2(y, x);
This returns the angle from the positive x-axis to the point (x, y), in radians. The result is greater than -π and less than or equal to π. The first argument is y, not x.