v=a+bsin(cx)表示的点阵图形怎么用C语言编程实现,求大侠们指点指点

来源:百度知道 编辑:UC知道 时间:2024/06/25 17:11:13
v=a+bsin(cx)表示的点阵图形怎么用C语言编程实现,求大侠们指点指点

数学有关角度的三角函数在C中的运用,常用的有:
acos (double x);
asin (double x);
atan (double x);
exp (double x);
sin (double x);
tan (double x);
cos (double x);
可能大家注意到了,这些三角函数的参数都是双精度的,平常我们常用的是角度制。在角度制中,我们把周角的1/360看作1度,那么,半周就是180度,一周就是360度,而三用角

函数的运算必须弧度制来表示,弧度制就是用弧的长度来度量角的大小的方法。绝对不能将角度直接代入以上的三角函数中,必须将角度转化为弧度制。即:360/2∏=57.29577951

即单位弧度所代表的角度。例如我们要求任意角度的三角函数以及任意值的反三角函数,则:
#i nclude<stdio.h>
#i nclude<math.h>
#define changshu 57.29577951
main()
{double zhi,arc, angle, PI=3.14159265358979323846;
float wsin,wtan,wacos,wcos,wasin,watan,wcot,wacot;
printf("please input the angle and the zhi you want to caculate:\nbe careful that the zhi you put must >=-1 and <=1.");
scanf("%lf,%lf",&angle,&zhi);
arc=angle/180*PI;
wsin=sin(arc);
wcos=cos(arc);
wtan=tan(arc);
wcot=1/wtan;
/*计算输入值的弧度*/
wacos=acos(zhi);