Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

HI-TECH programming problem

Status
Not open for further replies.
Wow!!!! You write it by yourself? Its so amazing!!!
So that means I still have a very very long journey to become a programmer.
By the way, some question here. How we going use those function?
For example if I wan to perform a calculation with equation
" x = y*sin(50) "
Then my code will be
float x = y * sine (50);

And at the cosine function, you add return 0 and the end of the function. Will that command return a zero value back to my main function and finally affect the calculation?
 
No the return is put there to stop a warning... The code should never reach that return... If it does there was an error.

Your example is correct.. The reason I changed the function name is... If I use cos(); instead of cosine(); I get a warning that there if a conflict, as cos(); is already defined..

The result is not perfect but for most applications it will do.
 
Ok.... a few things to remember..... up to 90.0 degree.... ( you'll have to take care of 90 -180 - 270 - 360 ). But that's pretty simple...

arccos returns the angle to two decimal places..... there are a few instances where it's 0.01 out... (I use these routines on cranes so they work pretty well).

So we have... cosine(); sine(); arctan(); arccos(); and arcsin(); also we have abs();

HI,

How to download this file it is not downloading and opening in new tab, why??
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top