Why doesn't sin() return the correct value?

前端 未结 1 1208
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-02 05:15

How do I use sin(), cos(), and tan() functions in iOS application? When I use this I didn\'t get the correct value. Example:



        
相关标签:
1条回答
  • 2021-01-02 05:52

    The problem is that it's taking the sine of 90 radians, not degrees. Try sin(M_PI_2) for 90°.

    0 讨论(0)
提交回复
热议问题