Go Down

Topic: Inverse trig functions (Read 3 times) previous topic - next topic

Jetfire

They locked this topic away in the arcives, so I'll just do this:


http://arduino.cc/forum/index.php?PHPSESSID=99fdf9fb9ed775fd5c50e3e70f03aec8&topic=41402.0


I need the <math.h> library and I can't find the .h and .ccp files.
Or if you could just tell me how to get the arc functions that would work too.

Thanks.

Jsut210

This may help http://arduino.cc/forum/index.php/topic,44229.0.html  
What happens if you just try something like:

Code: [Select]

float invsin = asin(num);

codlink

#2
Apr 05, 2013, 12:37 am Last Edit: Apr 05, 2013, 12:44 am by codlink Reason: 1
He's trying to tell you that the math library is already including in the IDE.  And actually, you don't have to use a header to include it either. [ref]http://arduino.cc/en/Math/H

Here's another library if you need more complexity.

http://playground.arduino.cc/Main/ComplexMath
//LiNK

robtillaart

note that the asin() return radians
- http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html -

The returned value is in the range [-pi/2, pi/2] radians. A domain error occurs for arguments not in the range [-1, +1].
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Jetfire

#4
Apr 05, 2013, 09:54 pm Last Edit: Apr 05, 2013, 10:21 pm by Jetfire Reason: 1
Ok cool

Rewrote my arcsin() as asin and that compiled fine.


Including the conversion formula for radians to degrees didn't work so well.

The value pi is apparently not included in the package.

Should I just use "3.14159265358979323846" or is there some other way?


Thanks

Go Up