View Single Post
  #1   Spotlight this post!  
Unread 20-01-2007, 17:24
Sykan's Avatar
Sykan Sykan is offline
Lead Programmer
AKA: David
FRC #0540 (Team 540)
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Virginia
Posts: 24
Sykan is on a distinguished road
Math.h sin syntax error

Im trying to use the math.h sin function but i keep getting a syntax error. Im trying to use trig to figure out how far away our bot is from the target light. Heres what's not working:


int targheight;
float dist;
targheight = 3;
dist = ((int)targheight * float sin(((3.14159 / 2) - ((((((int)TILT_SERVO - 190) * (65 / 124)) * (3.14159 / 180)))))) / float sin(float((((((int)TILT_SERVO - 190) * (65 / 124)) * (3.14159 / 180)));