fast sin and cos calculations for fixed point

Started by
3 comments, last by sherifffruitfly 18 years, 10 months ago
I'm using fixed point math to do my calculations in my game. I want to know whether sin and cos calculations can be done in a fast manner using fixed point. I'm using bitwise operations for my powers of 2 operations. Can someone suggest a faster way to calculate fixed point sine and cos calculations?
Advertisement
Look up tables are quick if you don't need really exact answers. Otherwise you could use the second or third order taylor series. They might be quicker to compute.
Lookup tables, possibly combined with interpolation, perhaps?
What do you need them for? There are fast methods to calculate consecutive values for example (for things like waveform generation).
I thought of look up tables. But I'm going to use it for mobile games development where fixed point math is used. So there is a memory constraint. I'll check up Taylor's equations.
Quote:Original post by sriniatig
I thought of look up tables. But I'm going to use it for mobile games development where fixed point math is used. So there is a memory constraint. I'll check up Taylor's equations.


Note: Taylor series are fine if you want to approximate functions only near a specific point. If you want to approximate functions over points throughout an interval, Taylor series will start to suck.

In that case you'll want to do something like a least-squares approx to your function, or use some set of orthogonal polynomials (Chebyshev, Legendre, etc). They all have their high points, depending on the nature of the approximation you need.

This topic is closed to new replies.

Advertisement