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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The problem is that it’s taking the sine of 90 radians, not degrees. Try
sin(M_PI_2)for 90°.