If I do this I get this:
print( ".5 \* sin 90 = " .. .5 \* math.sin( 90 ) )
–>> .5 * sin 90 = 0.44699…
but Wolfram gives me .5 :
http://www.wolframalpha.com/input/?i=.5+*+sin+90
What am I doing wrong?
Thanks!
If I do this I get this:
print( ".5 \* sin 90 = " .. .5 \* math.sin( 90 ) )
–>> .5 * sin 90 = 0.44699…
but Wolfram gives me .5 :
http://www.wolframalpha.com/input/?i=.5+*+sin+90
What am I doing wrong?
Thanks!
Hi,
By default the trig functions in Lua take their input as radians, not degrees, whereas Wolfram Alpha was smart enough to figure out that, with an input of 90, it probably meant degrees.
To convert from degrees to radians, you can use math.rad(). So if you do math.sin(math.rad(90)), you should get the result you expect.
Thanks!
easy to forget this
Nice link to resource
Hi,
By default the trig functions in Lua take their input as radians, not degrees, whereas Wolfram Alpha was smart enough to figure out that, with an input of 90, it probably meant degrees.
To convert from degrees to radians, you can use math.rad(). So if you do math.sin(math.rad(90)), you should get the result you expect.
Thanks!
easy to forget this
Nice link to resource