hi,
if you have 2 3d vectors U and V you can get the angle sine by:
1- normalize U and V
2- compute the cross product W = UxV
3- the angle sine is the length of W
4- use Math.asin() to get the angle from this sin.

I just realize there is simpler method:
1- normalize U and V
2- compute the dot product U.V , this is the value of cosine.
3- use Math.acos() to get the angle from this cos

Hope it helps,
 Olivier

Lehr, Ross (N-SGIS) a écrit :
Quick question... I know the Math.atan2 can get me an angle (in radians)
using y,x.  Can I also use atan2 to get a correct angle using z,x?  or
is there another way to get an angle when using the z coordinate?

Thanks!!
Ross
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
Olivier Besson (gludion) - (33 1) 44 64 78 99
http://wwww.gludion.com
http://blog.gludion.com

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to