Sign in to follow this  
INVERSED

sin/cos fast enough?

Recommended Posts

Hey, all. I know that this could just as easily be a math question, but I'm asking here because I'm asking specifically in refrence to matrix and Quaternion math. Has anyone found any compelling reason to use a sin cos table over sin and cos themselves? I started using a table because it just seems like on of those things you do, but I found that it introduced errors in my animation routines, as such I would much rather use the functions.

Share this post


Link to post
Share on other sites
A sin/cos lookup table will either eat up valuable cache or suffer from slow RAM. The CPU is a lot faster than RAM; if you're programming for a PC use the functions.

Lookup tables are useful for devices like the TI-89 or GBA; neither of those have hardware floats so lookup tables and fixed point are much faster. With a modern PC, however, it's best to use the functions.

Share this post


Link to post
Share on other sites
use sin/cos normally until you discover _with a profiler_ that the sin/cos code is actually causing a bottleneck in your app/game. it's generally never a problem.

-me

Share this post


Link to post
Share on other sites
Quote:
Original post by Palidine
use sin/cos normally until you discover _with a profiler_ that the sin/cos code is actually causing a bottleneck in your app/game. it's generally never a problem.

-me


Duh, you think I would have thought to think like that as that is how I usually think of things, but for some reason I didn't. That makes perfect sense.

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