Pages: [1]   Go Down
Author Topic: Inverse trig functions  (Read 6880 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all, I am just getting started with the Arduino and as I was reading through the programming reference I saw that the trig functions sin, cos, and tan are supported, but it looks like the inverse functions arcsin, arccos, and arctan are not.

My application will need some of these inverse functions. Is there any easy way to add them in? Do I need to modify and rebuild the Arduino compiler to do it?

Thanks much!

Logged

Earth
Offline Offline
Sr. Member
****
Karma: 14
Posts: 326
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like those functions exist to me. You can use avr lib-c from arduino:

http://www.nongnu.org/avr-libc/user-manual/modules.html
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh cool. I was going by the reference list given at http://arduino.cc/en/Reference/Extended which didn't show the inverse functions. I just added the library reference and the code compiled without errors.

Thanks much!
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It's an open secret around these parts that the Arduino uses C/C++ "under the hood". :-) The Arduino documentation is deliberately a subset of all available functions and syntax in order to keep the learning overhead low.

--Phil.
Logged

Pages: [1]   Go Up
Jump to: