cmath asin() problems
Hey so i managed to locate the problem in some graphics math i am coding, and apparently when i reach this line of code: float test3= asin(test2);
where test2= 0.017409846
.
to my understanding 'asin' is 'arc sin' which is 'inverse sin' (what i want) the result of this line of code however is test3 = 0.017410725
. when plugging this into my calculator inverse sine of test2 is开发者_运维百科 .997561.
Why isn't asin
working?? thanks!
Your calculator is set to degrees mode. The asin()
function returns radians.
Degrees and radians are related by the formula:
degrees = (180/π) * radians
It is working, you're using wrong units. asin
takes radians, and your calculator is probably in degrees mode.
arcsine return value is expressed in radians, not in degrees (your calculator is probably set to display degrees).
精彩评论