Sign in to follow this  
sriniatig

fast sin and cos calculations for fixed point

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this