fastTrig

I wrote a new fast trig library for C. My first version provided basic trig functions that worked on an 8-bit scale, and that's fine for the low performance robot control I'm doing right now, but I wanted to create a 16-bit version as well. In the interest of keeping the 16-bit functions as fast as possible, I used another lookup table and interpolated between values. Initially I wrote a fancy 3rd order interpolator, but its advantage over a linear interpolator was negligible with this spacing and it at least doubled the computation time, so I threw that away. The new fastTrig library provides sine, cosine, and tangent functions at both 8- and 16-bit precision using unsigned integer math.

https://gitlab.com/tllado/fastTrig

Comments