Go Down

Topic: Tables instead of radians? (Read 1 time) previous topic - next topic

Jellycow

Hey!
I'm working on a navigation-algorithm for my robot, including law of sines and law of cosines.
However, I do not get the right results from my formulas as the cos,sin and tan functions from Arduino only return degrees in radians.
That's why I'm asking if there's any functions that can give me return-values from the cos,sin and tan tables instead of radians?

Thanks in advance,

// Andreas

Grumpy_Mike

Why not just convert the returned value into degrees?
Two Pi radians is 360 degrees.

Osgeld

what are you looking for ...

like radians to degrees is as simple as d = r*(180/pi)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Jellycow



Why not just convert the returned value into degrees?
Two Pi radians is 360 degrees.


what are you looking for ...

like radians to degrees is as simple as d = r*(180/pi)


Hey!
I do not want a returned value into degrees, as my input value already is in degrees.
Instead, I want values from the cosine table like this https://www.grc.nasa.gov/WWW/k-12/airplane/tablcos.html.

Jellycow

Nevermind, I solved it :)
At first, I did for some reason thought that the radian was the output value, when it in fact was the input value.
So it was just about to create a function that converts degrees to radians by using the formula you gave me.

Thanks for your help!

Go Up