How do I use sin()
, cos()
, and tan()
functions in iOS application? When I use this I didn't get the correct value. Example:
double value=sin(90);
I got value: 0.893997 but expected value: 1. How can I fix this?
The problem is that it's taking the sine of 90 radians, not degrees. Try sin(M_PI_2)
for 90°.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With