包含頭文件 math.h
專注于為中小企業(yè)提供成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)新榮免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上千家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
反3角函數(shù)有 acos(double),asin(double),atan(double),atan(double,double),
返回值 double 型,弧度值。轉(zhuǎn)角度要 *180.0/3.1416
例如:
#include stdio.h
#includemath.h
int main()
{
double x=0.5;
printf("acos=%.2lf degrees\n",acos(x) * 180.0/3.1416);
printf("asin=%.2lf degrees\n",asin(x) * 180.0/3.1416);
printf("atan=%.2lf degrees\n",atan(x) * 180.0/3.1416);
printf("atan2=%.2lf degrees\n",atan2(1.0,2.0) * 180.0/3.1416);
return 0;
}
#includestdio.h
#include math.h
void main()
{
double a,b,c,d;
scanf("%f,%f",b,d);
a=sin(b);/*這是三角函數(shù)*/
c=asin(d);/*這是反三角函數(shù)*/
printf("sin(b)=%f,asin(d)=%d",a,c);
}
其他三角函數(shù)如cos(x)什么的,可以直接用,前提有math.h的頭文件
sacnf("%s",a);這個(gè)語句根本沒的用。就算輸入到a,也只會(huì)被當(dāng)成字符串來處理。
printf("%f",j);這個(gè)語句不知道是不是你寫錯(cuò)了,j前面沒逗號(hào)。
你想想反余切的公式就可以編程 出來了,這個(gè)東西最好要自己實(shí)踐,別人幫你只是指導(dǎo)你,對(duì)你編程沒有實(shí)際的好處。
包含頭文件?math.h
反3角函數(shù)有?acos(double),asin(double),atan(double),atan(double,double),
返回值?double?型,弧度值。轉(zhuǎn)角度要?*180.0/3.1416
例如:
#include?stdio.h
#includestdlib.h
#includemath.h
int?main()
{
double?x=0.5;
printf("acos=%.2lf?degrees\n",acos(x)?*?180.0/3.1416);?
printf("asin=%.2lf?degrees\n",asin(x)?*?180.0/3.1416);?
printf("atan=%.2lf?degrees\n",atan(x)?*?180.0/3.1416);?
printf("atan2=%.2lf?degrees\n",atan2(1.0,2.0)?*?180.0/3.1416);?
return?0;
}