Math.sin( ) Method | Flash 5; can be used when exporting Flash 4 movies |
compute the sine of an angle |
An angle, in radians (not degrees), normally in the range of 0 to 2, although any angle will suffice, as sine is a periodic function.
The sine of theta (the result is in the range of -1.0 to 1.0).
The sin( ) method returns the trigonometric sine of an angle. In a right triangle, the sine of an angle is the result of dividing the length of the side opposite the angle by the triangle's hypotenuse.
Note that sin( ) expects angles to be provided in radians, not degrees.
trace(Math.sin(0)); // Displays: 0 trace(Math.sin(Math.PI/2)); // Displays: 1.0
The sin( ) function can be used along with cos( ) to calculate a point on a circle. See the Example under Math.cos( ).
Math.asin( ), Math.cos( ), Math.PI, Math.tan( )