[1.4.0.3] Trigonometric functions wrong degree conversion?

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
Findus
Kobold
Posts: 7
Joined: Mon May 23, 2016 4:51 am

[1.4.0.3] Trigonometric functions wrong degree conversion?

Post by Findus »

I was very happy to finally see some math functions and I've tested them right away, so I've noticed that the trigonometric functions which use degrees are not working properly, while the ones who use radians work fine.

for example
math.sin(60) = 0.7475778912847248 (wrong)
math.sin_r(math.toRadians(60)) = 0.8660254037844386 (correct)

Look like that math.sin, math.cos, math.tan all make a wrong conversion to radians, using a costant conversion factor of around -0.01432655 (instad of the correct one 0.0174532...)

The inverted functions work just fine, using the same example i got:
math.asin(math.sin_r(math.toRadians(60))) = 59.99999999999999 (correct)
math.asin_r(math.sin_r(math.toRadians(60))) = 1.0471975511965976 (correct)
math.toRadians(60) = 1.0471975511965976 (correct)

Can someone check if you get the same results?

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Re: [1.4.0.3] Trigonometric functions wrong degree conversio

Post by Craig »

http://forums.rptools.net/viewtopic.php ... 16#p263116

Should be fixed in next build (which I will post around this weekend)

Post Reply

Return to “MapTool”