Tan math function brings different result.
Monkey Forums/Monkey Programming/Tan math function brings different result.
| ||
After getting some weird results in a function I did a test case for the tan function and I am getting different results. This is from Monkey Local testtan:Float = Tan(10.0) DebugLog(testtan) ' 0.17632697522640228 This line is from C# float testtan = (float)System.Math.Tan(10.0f); // testtan 0,6483608 float Any ideas for this or suggestions are welcomed. |
| ||
Monkey uses degrees for trig functions. Most languages (including Monkey 2 I think) use radians. So if you use 10.0 * 180.0 / PI in the Monkey version, you should get about the same result. |
| ||
Oh I see I made silly mistake, there is the Tanr function. Thanks :) |