开发者

How to use the asin() function in objective c

开发者 https://www.devze.com 2023-02-02 08:18 出处:网络
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 w

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消