What's the fastest way to calculate a vector angle?
If you want exact results, atan is the fastest.
But if you only need approximations, you can make a 2d lookup-table and use it.
But if you only need approximations, you can make a 2d lookup-table and use it.
The cosine of the angle between two vectors (in any number of dimensions) is equal to the dot product of the unit vectors. This would probably be less efficient than atan in 2d, but it ought to come in handy in 3d.
(untested and unoptimised)
(untested and unoptimised)
|
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement