I want to find the angle between two vectors so that I can rotate a billboard about the Y axis to face the camera. So I find the angle between the camera vector and a vector lieing on horizontal X axis (rotation about the Y axis = 0) and from that I can figure out what angle of rotation to apply to my billboard. I ended up doing a acos( ) lookup table, generating it in VC. It worked quite nicely.
The reason I dont use an inverse trig function is that J2ME does not have inverse trig functions. :)
Main Topics
Browse All Topics





by: ozoPosted on 2005-03-23 at 23:04:13ID: 13619334
a dot b / sqrt(a dot a * b dot b)
will give you the cosine of the angle between a and b
I don't think you can do much more without an inverse trig function of some form.
(otherwise whatever method you used could be used to implement an inverse trig function)
What do you want to do with the angle? And why don't you want to use an inverse trig function to do it?