包含頭文件 math.h

創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供靜安網(wǎng)站建設(shè)、靜安做網(wǎng)站、靜安網(wǎng)站設(shè)計、靜安網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、靜安企業(yè)網(wǎng)站模板建站服務(wù),十余年靜安做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。
反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;
}
#include math.h //包含數(shù)學(xué)函數(shù)庫就可以了
//可以使用atan() asin(), acos()等進行反三角函數(shù)計算
#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的頭文件
文章題目:c語言可以用反三角函數(shù)嘛,反三角函數(shù)編程
分享鏈接:http://chinadenli.net/article47/dsgcehj.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、網(wǎng)站制作、、服務(wù)器托管、軟件開發(fā)、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)