博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c++中atan2函数_atan2()函数以及C ++中的示例
阅读量:2539 次
发布时间:2019-05-11

本文共 1451 字,大约阅读时间需要 4 分钟。

c++中atan2函数

C ++ atan2()函数 (C++ atan2() function)

atan2() function is a library function of cmath header, it is used to find the principal value of the arc tangent of y/x, where y is the proportion of the y-coordinate and x is the proportion of the x-coordinate , it accepts two arguments (y, x) and returns arc tangent of y/x in radians.

atan2()函数cmath标头的库函数,用于查找y / x的反正切的主值,其中y是y坐标的比例, x是x坐标的比例,它接受两个参数(y,x)并以弧度返回y / x的反正切。

Syntax of atan2() function:

atan2()函数的语法:

atan2(y, x);

Parameter(s): y, x – are the numbers (proportions of y-coordinate and x-coordinate) to calculate the principal value of the arc tangent of y/x.

参数: y,x –是数字( y坐标x坐标的比例),用于计算y / x的反正切的主值。

Return value: double – it returns double type value that is the principal value of the arc tangent of y/x.

返回值: double-返回double类型的值,它是y / x的反正切的主要值。

Example:

例:

Input:    float x = -1.0;    float y = -2.5;        Function call:    atan2(y, x);            Output:    -1.9513

C ++代码演示atan2()函数的示例 (C++ code to demonstrate the example of atan2() function)

// C++ code to demonstrate the example of // atan2() function#include 
#include
using namespace std;// main() sectionint main(){
float x; float y; x = -1.0; y = -2.5; cout<<"atan2("<
<<","<
<<"): "<
<

Output

输出量

atan2(-2.5,-1): -1.9513atan2(22.5,11): 1.11608atan2(0,-1): 3.14159

Reference:

参考:

翻译自:

c++中atan2函数

转载地址:http://luxzd.baihongyu.com/

你可能感兴趣的文章
[T-ARA/筷子兄弟][Little Apple]
查看>>
编译Libgdiplus遇到的问题
查看>>
【NOIP 模拟赛】Evensgn 剪树枝 树形dp
查看>>
java学习笔记④MySql数据库--01/02 database table 数据的增删改
查看>>
两台电脑如何实现共享文件
查看>>
组合模式Composite
查看>>
程序员最想得到的十大证件,你最想得到哪个?
查看>>
我的第一篇CBBLOGS博客
查看>>
【MyBean调试笔记】接口的使用和清理
查看>>
07 js自定义函数
查看>>
jQueru中数据交换格式XML和JSON对比
查看>>
form表单序列化后的数据转json对象
查看>>
[PYTHON]一个简单的单元測试框架
查看>>
iOS开发网络篇—XML数据的解析
查看>>
[BZOJ4303]数列
查看>>
一般处理程序在VS2012中打开问题
查看>>
C语言中的++和--
查看>>
thinkphp3.2.3入口文件详解
查看>>
POJ 1141 Brackets Sequence
查看>>
Ubuntu 18.04 root 使用ssh密钥远程登陆
查看>>