Linux C function() 參考手冊:atan2(取得反正切函數值)

Linux C function() 參考手冊:atan2(取得反正切函數值)

Linux C function() 參考手冊:atan2(取得反正切函數值)

 

資料來源:http://people.cs.nctu.edu.tw/~yslin/library/linuxc/main.htm
線上執行:http://www.tutorialspoint.com/compile_c_online.php
code2html:http://tohtml.com/

相關函數
acos,asin,atan,cos,sin,tan
表頭文件
#include<math.h>
定義函數
double atan2(double y,double x);
函數說明
atan2()用來計算參數y/x的反正切值,然後將結果返回。
返回值
返回-PI/2 至PI/2 之間的計算結果。
附加說明
使用GCC編譯時請加入-lm。
範例

 

#include <math.h>
int main()
{
double angle;
angle = atan2(1,2);
printf("angle = %f\n", angle/3.14159*180);
return 0;
}

 

 


發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *