View Single Post
  #1   Spotlight this post!  
Unread 04-02-2005, 20:39
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Weird tangus value (i. e. tan(75)=27,XXX)

I have been working on using trigonometric functions in our code (In order to calculate distance from robot to vision tetra) and while it is able to calculate the value of tan(45) as 1, any other tan(x) value would be a decimal value, therefore i changed the variable that i had stored the value in to a float type, and told it to calculate some other tan(x) values (Just to make sure that the functions works). I have been getting as an answer some huge 5 digit numbers such as the one in the subject (Where 'XXX' is some 3 random numbers). Most of these numbers are somewhere near various powers of 2, such as 2^14, and 2^16. This has been happening with both Team 296 CORDIC Math library, and the math.h library that comes with the mcc18 compiler. Does anyone know what might be causing this?

Thank you for the help,

Dan