很久不发博客了,今天在园中计算各种角,于是复习下fan正切函数
计算x的反正切值 (atanatanf和 atanl) 或y/x 的反正切值 (atan2atan2f和 atan2l)。
 
 
double atan(
double x
);
float atan(
float x
); // C++ only
long double atan(
long double x
); // C++ only
double atan2(
double y,
double x
);
float atan2(
float y,
float x
); // C++ only
long double atan2(
long double y,
long double x
); // C++ only
float atanf(
float x
);
long double atanl(
long double x
);
float atan2f(
float y,
float x
);
long double atan2l(
long double y,
long double x
);
参数

 
x, y

任何数量。

返回值

 
atan 返回 x –π/2 到π/2弧度范围内的反正切值。 atan2 返回 y/x –π/2 到π/2弧度范围内的反正切值。如果 x 为0,则 atan返回0 。 如果 atan2 的参数都是 0,则函数返回 0。 所有结果以弧度为单位。

atan2 使用两个参数的符号标识确定返回值的象限。

 

输入

SEH 异常

Matherr 异常

± QNAN,IND

_DOMAIN

备注

 

atan 函数求x的反正切值 (反正切函数) 。 atan2 计算 y/x 反正切值 (如果 x 等于 0,atan2 返回π/2,如果 y 为正数的,-π/2,如果 y 为负或 0,则 y 为 0。)

atan 具有使用Streaming SIMD Extensions 2(SSE2)的实现。 有关使用SSE2实现的信息和限制,请参见_set_SSE2_enable

由于 C++ 允许重载,可以调用 atanatan2重载函数。 在 C 程序中,atan 和 atan2 始终采用并返回两个。

要求

 

例程

必需的标头

atanatan2atanfatan2fatanlatan2l

<math.h>

示例

 

 
// crt_atan.c
// arguments: 5 0.5
#include <math.h>
#include <stdio.h>
#include <errno.h> int main( int ac, char* av[] )
{
double x, y, theta;
if( ac != 3 ){
fprintf( stderr, "Usage: %s <x> <y>\n", av[0] );
return 1;
}
x = atof( av[1] );
theta = atan( x );
printf( "Arctangent of %f: %f\n", x, theta );
y = atof( av[2] );
theta = atan2( y, x );
printf( "Arctangent of %f / %f: %f\n", y, x, theta );
return 0;
}

最新文章

  1. iOS widget开发
  2. 前端基础 JavaScript~~~ 数据处理 奇技淫巧!!!!!!
  3. ECMAScript 6教程 (二) 对象和函数
  4. Apache配置代理服务器的方法(1)
  5. 拆分ABBYY FineReader 12文档的方法
  6. hdu - 2216 Game III &amp;&amp; xtu 1187 Double Maze (两个点的普通bfs)
  7. core&mdash;线程与IO
  8. 如何开发原生的 JavaScript 插件(知识点+写法)
  9. 将excel数据导入内表的函数
  10. 超酷创意HTML5动画演示及代码
  11. 360云后台(使用HTTP Cache服务器)
  12. Linux学习之chage命令
  13. Ubuntu14.04 Y460闪屏问题解决方案
  14. TreeSet源码分析
  15. UVAlive 3708 Graveyard(最优化问题)
  16. Python 3.3.2 round函数并非&quot;四舍五入&quot;
  17. lvm语法2
  18. node.js 远程调试debug产线环境代码
  19. MongoDB数据库去重
  20. Python文档记录

热门文章

  1. 【2019.11.27】SDN课程阅读作业(2)
  2. updateprimarykey 和updateprimaryKeySelective
  3. PyCharm虚拟环(Project Interpreter)手动安装第三方包图解教程
  4. C#使用SHA1加密类(RSAFromPkcs8)支持1024位和2048位私钥
  5. Git push origin dev-rgq-istokenstatus 【dev-rgq-istokenstatus -&gt; dev-rgq-istokenstatus】
  6. 运行 puppeteer 报错 chrome: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory
  7. 决策树分析、EMV(期望货币值)
  8. WebGL学习笔记(五):变换库
  9. matlab学习笔记9 高级绘图命令_1 图形对象_根对象,轴对象,用户控制对象,用户菜单对象
  10. [LeetCode] 369. Plus One Linked List 链表加一运算