Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Math functionality in EasyC? (http://www.chiefdelphi.com/forums/showthread.php?t=43692)

scottmso 10-02-2006 09:49

Math functionality in EasyC?
 
I'm trying to see if I can design a function to help calculate a trajectory for our robot. Does EasyC have the math libraries that I would need to do this such as sin, cos, and tan? The other programmers didn't want to learn C this year (even though they had the opportunity) and seem to want to use EasyC but I would personally rather program it in regular C (MPLAB) especially if I will need to use it for what I want to do. Thanks

BradAMiller 11-02-2006 08:16

Re: Math functionality in EasyC?
 
Quote:

Originally Posted by scottmso
I'm trying to see if I can design a function to help calculate a trajectory for our robot. Does EasyC have the math libraries that I would need to do this such as sin, cos, and tan? The other programmers didn't want to learn C this year (even though they had the opportunity) and seem to want to use EasyC but I would personally rather program it in regular C (MPLAB) especially if I will need to use it for what I want to do. Thanks

You can get all the standard math libraries which are described in the Microchip C18 Users Guide. To do this and not get compiler errors you must include <math.h> which can be done from the "File inclusion" dialog on the Options menu. Make sure to include the <> as part of the file name.

JJMax7 14-02-2006 17:29

Re: Math functionality in EasyC?
 
Where should we place the math.h file?

Tobaby817 14-02-2006 17:36

Re: Math functionality in EasyC?
 
in the file where you use the mathematical functions. #includes are only useful for the file you put them in

intelitek_Chris 14-02-2006 21:11

Re: Math functionality in EasyC?
 
The math header file is already included in the compiler. All you need to do is go to the File Inclusion Window in the options menu, and type in:
'
<math.h>
'
Then you will have access to the functions provided by that header file, such as sin, cos, tan, etc.

TEAM1949 16-02-2006 09:59

Re: Math functionality in EasyC?
 
after I include the file I wiil be able to see it like that : #include <sdsdsd>
????

Or it will automaticlly put it in the main.h ?

gabrielse 16-02-2006 11:19

Re: Math functionality in EasyC?
 
Quote:

Originally Posted by TEAM1949
after I include the file I wiil be able to see it like that : #include <sdsdsd>
????

Or it will automaticlly put it in the main.h ?

Give it a try, just don't forget that math.h uses radians to measure angles.

BradAMiller 16-02-2006 14:52

Re: Math functionality in EasyC?
 
Quote:

Originally Posted by TEAM1949
after I include the file I wiil be able to see it like that : #include <sdsdsd>
????

Or it will automaticlly put it in the main.h ?

The actual include declaration gets inserted into the Main.h file as you said and the Main.h file is included in all the other files you create.

The only way to see it is to look at the "Project" tab on the left hand window. Then you can select Main.h and see the includes.


All times are GMT -5. The time now is 06:15.

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