mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 15:04:05 +08:00
36 lines
833 B
HTML
36 lines
833 B
HTML
<h1>数学函数 - atan2</h1>
|
||
|
||
|
||
<p>原型:extern float atan2(float y, float x);</p>
|
||
|
||
<p>用法:#include <math.h></p>
|
||
|
||
<p>功能:求y/x(弧度表示)的反正切值</p>
|
||
|
||
<p>说明:值域为(-π/2,+π/2)。</p>
|
||
|
||
举例:<pre>
|
||
|
||
// atan2.c
|
||
|
||
#include <syslib.h>
|
||
#include <math.h>
|
||
|
||
main()
|
||
{
|
||
float x,y;
|
||
|
||
clrscr(); // clear screen
|
||
textmode(0x00); // 6 lines per LCD screen
|
||
|
||
x=0.064;
|
||
y=0.2;
|
||
printf("atan2(%.3f,%.2f)=%.4f",y,x,atan2(y,x));
|
||
|
||
getchar();
|
||
return 0;
|
||
}
|
||
|
||
</pre>相关函数:<a href="asin.html">asin</a>,<a href="acos.html">acos</a>,<a href="atan.html">atan</a>,<a href="sin.html">sin</a>,<a href="cos.html">cos</a>,<a href="tan.html">tan</a>
|
||
|