函数名: sin
头文件:<math.h>
函数原型: double sin(double x);
功 能: 正弦函数
参 数: double x 操作的弧度
返回值: 返回弧度的正弦值
1°=π/180°弧度
这是C标准库的定义;
#include<stdio.h>
 
#include<math.h>
 
#define PI 3.14159265
 
int main(void){
 
   double result, x = 37*PI/180; //灏?0搴﹁杞崲鎴愬姬搴?
 
   result = sin(x); 
 
   printf("The sin() of %lf is %lf\n", x, result);
 
   return 0;
 
} 
 
也可以做一个程序来证明一些数学关系,如,
 
VC6新建一个对话框工程;设计界面如下并为编辑框添加成员变量;
 
在对话框的实现文件包含<math.h>,按钮单击函数如下,
void CSinDlg::OnButton1() 
{
	// TODO: Add your control notification handler code here	
	UpdateData(TRUE);
	mresult = sin(m_sin) * sin(m_sin) + cos(m_cos) * cos(m_cos);
    UpdateData(FALSE);
} 
运行几次看一下;
 
 
如果2个输入框值不等结果就不会等于1;
 



















