Math in ActionScript
You will be surprised to find out just how much math is involved in ActionScript animation. Here are some formulas you will need to know in order to work ActionScript to do hat you want it to:
Trigonometry
Radians & degrees
In ActionScript, if you wish to measure angles you must do so with radians, in the real world you are comfortable with degrees, but this is not the real world this is computer world and the ActionScript needs the value of the angles in radians, and so you must convert your angles from degrees to radians using the following formulas:
radians = degrees * (Math.PI / 180)
EXEMPLE: radians = 45 * (Math.PI / 180) = 45 * 0.0174532925 = 0.7853981634
45 degrees is 0.7853981634 radiansdegrees = radians * (180 /Math.PI)
EXEMPLE: degrees = 1 * (180 /Math.PI) = 1 * 57.29577951 = 57.29577951
1 radian is 57.29577951 degrees
Coordination system in Flash
The coordination system of Flash is a bit up side down, where in normal maths, the point 0(0;0) is found either in the centre or at the bottom left, in Flash it is always found in the top left. And so when ever you will be dealing with coordinates, don't forget that sometimes the results are misleading, such as, how do you vision a -30 degree line? Normally a minus 30 degree line would be found under point 0 and so going downwards, but in Flash it goes upwards still respecting the negative value side of the axis.
Functions

Figure 1 - h= Hypotenuse; C1 = the adjacent Leg ; C2 = the opposite Leg
Sine
Math.sin(value in radians) = the Math.sin() function calculates calculates the ratio between the hypotenuse and the opposite leg (that's side named h and C2 in the figure).
If the angle is 30 degrees, then:
Math.sin(degrees * (Math.PI / 180)) = Math.sin(30*(Math.PI / 180)) = 0.5
And so the opposite leg measures "hypotenuse * 0.5"
Remember that this function should be used in the following case: 
Cosine
Math.cos(value in radians) = the Math.cos() function calculates the ratio of the adjacent leg to the hypotenuse. If the angle is 45 degrees, then:
Math.cos(degrees * (Math.PI / 180)) = Math.cos(45 * (Math.PI / 180)) = 0.7071067812
So now if you imagine that you hypotenuse is 20 in length, the your adjacent leg measures 20 * 0.7071067812 = 14.14213562
Remember that this function should be used in the following case: 
Tangent
Math.tan(value in radians) = the |Math.tan() function calculates the ratio of the opposite leg to the adjacent leg. If the angle is 50 degrees, then:
Math.tan(degrees * (Math.PI / 180)) = Math.tan(50 * (Math.PI / 180)) = 1.191753593
So now if your adjacent leg is 10 in length then, the opposite leg measures 10 * 1.191753593 = 11.91753593
Remember that this function should be used in the following case: 
Arcsine
Math.asin(value as a ratio) = When you use sine ( Math.sin() ), you already know an angle and you want to find out the number by which to multiply the hypotenuse in order to calculate the length of the opposite leg, well this function, Math.asin() works the other way round, you know the ratio of the hypotenuse to the opposite leg and you want to know by what angle this ratio corresponds.
If you know the ratio between the hypotenuse and the opposite leg, then you can use this value to find out the angle needed to produce that ratio, say if the hypotenuse measures 10 and the opposite leg measures 5:
Math.asin(opposite leg/hypotenuse) = Math.asin(5/10) = Math.asin(0.5) = 30
So if the ratio between the hypotenuse and the opposite leg is 0.5, you have an angle of 30 degrees.
Remember that this function should be used in the following case: 
Arccosine
Math.acos(value as a ratio) = This works in the same way as Arcsine, but here you can find out the angle corresponding to the ratio between the hypotenuse and the adjacent leg.
If your hypotenuse measures 10 and your adjacent leg measures 4, then the ratio between them is 4/10 = 0.4 ; you can calculate the angle like so:
Math.acos(adjacent leg/hypotenuse) =
Math.acos(0.4) = 66.42182152
So if the ratio between the hypotenuse and the adjacent leg is 0.4, you have an angle of about 66.4 degrees.
Remember that this function should be used in the following case: 
Arctangent
Math.atan(value as a ratio) = This is one of the most used trig functions in ActionScript, when you know the ratio between the adjacent leg and the opposite leg you can calculate the angle that corresponds to this value by using this function Math.atan()
Example: is the opposite leg is 1 and the adjacent leg is 2, so the ratio is: 1/2 = 0.5 ; the angle that corresponds to this ratio is:
Math.atan(opposite leg / adjacent leg) = Math.atan(1/2) = Math.atan(0.5) = 26.56505118
The angle is roughly 26.5 degrees
Remember that this function should be used in the following case: 
Arctangent 2
Math.atan2(y, x) = This will be used much more often then Arctangent and is used to solve such problems as illustrated below:

Math.atan2(y, x) takes into account the y and x positions, and so calculates the angle differently allowing to calculate the angle not by a ratio but by the y and x positions directly.
So, the C angle is:
Math.atan2(1, 2) = 0.463647609000806
But that can't be right, you may have noticed, yes I didn't convert the radians into degrees, the correct way:
Math.atan2(1,2) * 180 / Math.PI = 26.565051177078
D angle is:
Math.atan2(1,-2) * 180 / Math.PI = 153.434948822922
You may wonder where this number has come from, well in Flash, the the angles are measured from the positive side of the x axis clockwise, and so where C angle was about 26.5 degrees, D angle is about 153.4 degrees from the start point of the positive side of the x axis.
The degrees will go up to 180, before taking a negative value (which works out to be the shortest route to tracing the hypotenuse from the positive x axis starting point.
And so angle A is -153.434948822922 but it is also 206.5650512 but as 153 degrees is a shorter way to draw the hypotenuse then 206 degrees, Flash retains 206 degrees.