To improve algorithm performance, one direct way is to shorten calculation time. The part that consumes the most computation power would be the trig functions.
The built-in trig functions are generally very good in terms of accuracy. But we don't need that level of precision, so we can sacrifice accuracy to achieve faster speed.
We only use SIN, COS, ACOS and ATAN in our algorithm, so this post will describe only these functions.