![]() |
White Paper Discuss: 296's CORDIC Math Library
Thread created automatically to discuss a document in the White Papers.
296's CORDIC Math Library by Pat Fairbank |
Re: White Paper Discuss: 296's CORDIC Math Library
Hello all,
We at 296 decided to share our student-developed math library with the CD community. We needed trig functions for our robot positioning system, so we wrote our own using the CORDIC algorithm. The library includes integer sine, cosine, and arctangent, all accurate to +- 1/16777216, as well as a few other useful functions. I hope this comes in useful for those of you who need accurate trig functions. |
Re: White Paper Discuss: 296's CORDIC Math Library
A "Short Long"? Isn't this contradictive? or just an oxymoron? I thought there were short ints and long ints.
|
Re: White Paper Discuss: 296's CORDIC Math Library
Well, short ints are 16 bit, long ints are 32, and I guess that they needed a name for a 24 bit int, so they called it a short long.
|
Re: White Paper Discuss: 296's CORDIC Math Library
We didn't use trig in our final implementation ... but in testing we did consider it, and also decided on the CORDIC algorithm. There is an added advantage of CORDIC that your library currently doesn't utilize -- it can compute both the sin and cosine at the same time (which you do, but then you throw one of them away). For our trig needs, anyway, we needed the sin and cos of the same angles.
Implementing this in a math library (admittedly more general than our custom implementation), would be interesting conceptually. Maybe create a structure called angle. Code:
struct angle { |
Re: White Paper Discuss: 296's CORDIC Math Library
Quote:
Be that as it may, here's my suggestion of an implementation: Code:
typedef enum {wantsSin, wantsCos} WhichFunc;
|
| All times are GMT -5. The time now is 14:12. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi