c语言能直接输入三角函数符号嘛 比如sin cos?

c语言能直接输入三角函数符号嘛 比如sin cos


凤凰求蛊
浏览 2051回答 2
2回答

扬帆大鱼

可以,是标准C函数,语法如下#include <math.h>double sin(double x);double cos(double x);详细描述:NAMEsin, sinf, sinl - sine functionSYNOPSIS#include <math.h>double sin(double x);float sinf(float x);long double sinl(long double x);Link with -lm.DESCRIPTIONThe sin() function returns the sine of x, where x is given in radians.RETURN VALUEThe sin() function returns a value between -1&nbsp;and&nbsp;1.CONFORMING TOSVr4, 4.3BSD, C89. The float&nbsp;and&nbsp;long double variants are C99 requirements.SEE ALSOacos(3), asin(3), atan(3),&nbsp;atan2(3), csin(3), cos(3), tan(3)

慕斯709654

#include "stdio.h"#include "math.h"void main (){float i=1.0;printf("%f",sin(i));}当然可以
打开App,查看更多内容
随时随地看视频慕课网APP