wer we use.....x= r cos(angle) and y= r sin(angle) ( is this for poviding motion to object)
and why we use
angle=Math.atan(yspeed/(xspeed *1))/math.Pi/180...
is this for cal angle ..wats the meaning of arc tangent....
wer we use.....x= r cos(angle) and y= r sin(angle) ( is this for poviding motion to object)
and why we use
angle=Math.atan(yspeed/(xspeed *1))/math.Pi/180...
is this for cal angle ..wats the meaning of arc tangent....
Its: angle=Math.atan(yspeed/xspeed)*180/Math.PIwer we use.....x= r cos(angle) and y= r sin(angle) ( is this for poviding motion to object)
and why we use
angle=Math.atan(yspeed/(xspeed *1))/math.Pi/180...
is this for cal angle ..wats the meaning of arc tangent....
It is used to find the current angle the object is travelling in.
I you want to understand, as i always do, you can look at some triganometery websites that will explain sine, cosine and tangent, as well as their inverses, arcsine, arccosine, and arctangent and how to use them.
Try to relate the triangles used in the websites to your graphical display, the amount of x pixels is the length of the adjacent side and the amount of y pixels is the length of the opposite side  etc.
I find its always nice to know how somthing works rather than just going by formulae.
Last edited by dozza92; August 29th, 2008 at 03:08 PM. Reason: wrong use of terms
And the *180/Math.PI is for converting from radians to degrees.
Flash uses degrees for the rotation property, but uses radians for the trig functions, so you need to convert between the two, sometimes.
There are currently 1 users browsing this thread. (0 members and 1 guests)
