Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpSyntax › Sin and Inverse Sin

Page Index Toggle Pages: 1
Sin and Inverse Sin (Read 8540 times)
06/01/08 at 18:56:45

Titus   Offline
Full Member
Wiring Soccer Robot!
Amsterdam

Posts: 176
***
 
Dear Barragan,

We, Kars and I, wondered how to do the Inverse sinus/cosinus/tangens in wiring.
A sinus does
sin(angle);   => value from -1 to 1

But how do you get the angle from that value between -1 and 1

like:
value is between -1 and 1
sinInv(value);=> angle.

Thanks for the fast reply!

Titus
 

Check www.TeamVossius.nl for our Autonomous soccer robots!
IP Logged
 
Reply #1 - 06/02/08 at 22:56:15

N201LJ   Offline
YaBB Newbies
darwin is my copilot
USA

Posts: 13
*
 
Lookup table?

It's not in the AVR math.h library?
 

alan duncan&&to email me, use: lastname dot firstname @ mac dot com
IP Logged
 
Reply #2 - 06/02/08 at 23:53:51

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
hi, here is the documentation of what´s included in avr math.h http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html
By default the library is included in the Wiring sketch.
 
IP Logged
 
Reply #3 - 06/03/08 at 16:40:15

Titus   Offline
Full Member
Wiring Soccer Robot!
Amsterdam

Posts: 176
***
 
The awnser I was looking for is:

int x=round(  degrees  (  atan  (  1  )  )  );

Barragan,
perhaps in the reference, the
atan();
asin();
acos();

Could be added?

The convert a number from -1 to 1, to the according value in radian
Because I needed it to be in degrees, and to be an int, I added the degrees() and the round() command.

Found this out, perhaps more people need it.

Titus
 

Check www.TeamVossius.nl for our Autonomous soccer robots!
IP Logged
 
Reply #4 - 06/04/08 at 16:04:07

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
definitely, I added it to the list.
 
IP Logged
 
Reply #5 - 04/18/09 at 12:14:15

Titus   Offline
Full Member
Wiring Soccer Robot!
Amsterdam

Posts: 176
***
 
I needed it again today, but I didn't remember how to do it.
It wasn't added to the reference yet?
Luckely I found this topic again

Titus
P.S. change for 0019?
 

Check www.TeamVossius.nl for our Autonomous soccer robots!
IP Logged
 
Page Index Toggle Pages: 1