Thread: Trig problems
View Single Post
  #4   Spotlight this post!  
Unread 17-02-2006, 21:57
revolution1737 revolution1737 is offline
Robot Overlord
FRC #1691 (Revolution1737)
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Sidney
Posts: 9
revolution1737 will become famous soon enough
Re: Trig problems

Quote:
Originally Posted by revolution1737
I have tried Kevin Watson's trig code with the eeprom, a cordic approach (team 226's code i think), and the default sin function in math.h and every time I come out with a wrong value when I print. I usually get 16512 or 0. I have tried switching from radians to degrees. Am I just getting unlucky or is there something I'm missing?
Code:
float meh;
angle = sin(3.14);
printf("the angle is = %d\r\n",meh );

Stupid me

Code:
float angle;
angle = sin(3.14);
printf("the angle is = %d\r\n",angle );
[/quote]

There, I think...