I am trying to use the asin() fu开发者_如何学JAVAnction in an iOS app to calculate an angle from the y axis. I am using trigonometry, but I must be doing something wrong with the asin() function, as when I try to pass in 0.707.... as asin(rotation) where rotation is a double equivalent to 0.707..., I get around 0.78....., where as my calculator gives me 44.991..., which is about correct from the variables passed in. What am I doing wrong, please can somebody help me?
Your calculator is probably set to degrees. Most computer libraries use radians. You can convert using the formula degrees = radians*180/pi
.
精彩评论