RealRTTV / chatcalc

a port of chatcalc to 1.19-1.20
Mozilla Public License 2.0
11 stars 5 forks source link

Inverse trig functions are broken #11

Closed thecolonel63 closed 1 year ago

thecolonel63 commented 1 year ago

The inverse trig functions are producing incorrect results.

My main guess as to what is going wrong is your parser is trying to resolve the base trig functions (sin, cos, tan) before the inverse functions (arcsin, arccos, arctan), but this doesn't explain the odd behavior around arccos output

Examples:

arcsin(1) -> Should be 90 but got 0.02 arccos(1) -> Should be 0 but got 1.55 arctan(1) -> Should be 45 but got 0.02

sin(arcsin(1)) -> Should be 1 but got 0 cos(arccos(0)) -> Should be 0 but got 1 tan(arctan(1)) -> Should be 1 but got 0