MathArcsin wrong results

To add comments, please log in or register
gouki1001
341
gouki1001  

rad = (((oppl+.0))/hypl)*((M_PI+.0)/180); (0.01698095)
angle = MathArcsin(rad); (Im getting 0.01698176 instead of 0.97298353134226625915034235162797)


But the MathArcsin is not giving the correct answer. Anyone experienced with MathArcsin in MQL4 or other trigonometric functions?

lippmaje
1040
lippmaje  
gouki1001:

rad = (((oppl+.0))/hypl)*((M_PI+.0)/180); (0.01698095)
angle = MathArcsin(rad); (Im getting 0.01698176 instead of 0.97298353134226625915034235162797)


But the MathArcsin is not giving the correct answer. Anyone experienced with MathArcsin in MQL4 or other trigonometric functions?

Sin() gets an angle in Radiant as input and returns a value in the range [-1.0, 1.0]. Arcsin() does the reverse, it gets [-1.0, 1.0] as input and returns a radiant. It looks like you're doing the radiant conversion too early.
To add comments, please log in or register