Go to Post You can't guarantee outcomes -- only effort. If your team did its best, be satisfied. - Rick TYler [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 04-02-2007, 19:07
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Storing functions to variables

Remember that in C, those aren't functions or equations. They are statements, executed once.

To assign a function to a variable would be something like:
Code:
(type omitted) myfunc = tan;
So you need to declare all three variables, like so:
Code:
int tilt_angD = ((((int)TILT_SERVO - 124) * 65)/124));
double tilt_angR = ((tilt_angD *3.14159265)/180.0);
double dist = (80.0/tan(tilt_angR));
Just watch out for integer math.

Just be careful about your floating-point expressions, the RC doesn't like them much.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing the balls Max Brin Technical Discussion 4 18-02-2006 20:34
Math.h and Functions and Variables amateurrobotguy Programming 1 26-02-2005 03:19
PDF of all functions/variables! mikesown Programming 1 01-02-2005 18:56
Storing Tetras on Robot MisterX General Forum 22 15-01-2005 19:26
SCORing vs. STORing Chris Fultz General Forum 3 15-01-2004 13:36


All times are GMT -5. The time now is 23:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi