#include<stdio.h> #include<math.h> int main() { double a; a=sin(45); printf("f%",a); }为什么不能显示45度角的对边比斜边??显示的是f
慕侠2389804
浏览 150回答 2
2回答
陪伴而非守候
要用弧度计算的,另外,pintf语句中,应该是"%lf",不是"f%"sin()是三角函数,参数使用的是弧度,不是度。asin()才是反三角函数。资料 :NAMEasin, asinf, asinl - arc sine functionSYNOPSIS#include <math.h>double asin(double x);float asinf(float x);long double asinl(long double x);Link with -lm.DESCRIPTIONThe asin() function calculates the arc sine of x; that is the valuewhose sine is x. If x falls outside the range -1 to 1, asin() failsand errno is set.RETURN VALUEThe asin() function returns the arc sine in radians and the value ismathematically defined to be between -PI/2 and PI/2 (inclusive).