Today, I am going to try to optimize Math.atan2(y,x), atan2 is very useful when working with polar coordinates. Here the definition of atan2: Based on the definition, we will have to deal with multiple quadrants, but here some useful maths we can use: atan(-x) = -atan(x) atan(1/x) = PI/2 – atan(x) for x>0 =-PI/2 – […]

~ read more ~## Posts tagged Trigonometry

# Math.sin tricks

Math.sin is slow, we have many options to optimize it, a good post from Jackson dunstan “Even Faster Trig Through Inlining” show lots of methods (http://jacksondunstan.com/articles/1213) But there is a major problem with all the proposed methods : it only works for a certain range of angle, and if you want to use those functions […]

~ read more ~
## Recent Comments