Is atan2 better than acos,asin for optimization?

Is atan2 better than acos,asin for optimization?
acos and asin need to calculate hypotenuse as opposed to atan2,
So i think that atan2 is better for optimization.
Is it true?

Optimization for what…? atan2 just handles zero values for you as opposed to atan. Hypotenuses have nothing to do with things in this case and trigonometric functions are in relation to right triangles simply because that’s what forms from an X and Y component.

Trig functions are just ratio calculations.

Unless you have a bottleneck somewhere, I wouldn’t worry about micro optimizations like this.

1 Like

You should choose the trig functions that fits your scenario best. If you have the opposite and adjacent sides, use arctan. If you have the opposite and hypotenuse, use arcsin. etc.

All trigonometric functions are very fast, as they all use the CORDIC algorithm (to my knowledge), so don’t worry about speed.

This type of micro-optimization is unnecessary.

1 Like