Here are some of the trigonometric functions that are commonly used in AS3.0. The code is as follows:
Trace (Math.tan (45*math.pi/180)),//45 degree angle is known to seek tangent value, trace (Math.atan (1) *180/math.pi),//The tangent value is known to be 1 to find out the angle; trace (Math.sin (30* math.pi/180));//30-degree angle is known to seek sine value, trace (math.asin) *180/math.pi,///known sine value 0.5 for angle; trace (Math.Cos (60*math.pi/180));// The cosine value of the 60 degree angle is known, the Trace (Math.acos (*180/MATH.PI));//The angle of the known cosine 0.5;//The coordinates of two points are known to calculate the angle var between two points $point 1:point = new Point ( 100,100) var $point 2:point = new Point (200,200), var angle:number = math.atan2 ($point 2.y-$point 1.y, $point 2.x-$point 1.x ) * 180/MATH.PI;IF (Angle < 0) {angle = angle + 360;//limit angle in [0,360] range;} Trace (angle)
Trigonometric functions in the AS3.0