开发者

Difficulty using trignometric functions in iPhone app

开发者 https://www.devze.com 2023-02-20 05:47 出处:网络
in a开发者_C百科n iphone application i want to use the trignometic functions. but the answer is not coming correctly.

in a开发者_C百科n iphone application i want to use the trignometic functions. but the answer is not coming correctly. this is my code:

#include"math.h"
double tri;
tri=sin(90);
printf("%lf",tri);

for this the answer is coming as 0.893977 how can i correct the code to get the answer as 1


double tri; 
tri=sin(90.0 * 3.1415926/180.0); 
printf("%lf",tri);


The arguments to standard trigonometric functions should be supplied in radians, not degrees.

0

精彩评论

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

关注公众号