开发者

Difficulty using trignometric functions in iPhone app

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜