c++中atan2函数_atan2()函数以及C ++中的示例

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 <iostream>
#include <cmath>
using namespace std;
// main() section
int main()
{
float x;
float y;
x = -1.0;
y = -2.5;
cout<<"atan2("<<y<<","<<x<<"): "<<atan2(y,x)<<endl;
x = 11.0;
y = 22.5;
cout<<"atan2("<<y<<","<<x<<"): "<<atan2(y,x)<<endl;
x = -1.0;
y = 0;
cout<<"atan2("<<y<<","<<x<<"): "<<atan2(y,x)<<endl;    
return 0;
}

Output

输出量

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

Reference: C++ atan2() function

参考: C ++ atan2()函数

翻译自: https://www.includehelp.com/cpp-tutorial/atan2-function-with-example.aspx

c++中atan2函数

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/542966.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python不合法的布尔表达式_python测试题

一、填空题 1.Python使用符号标示注释;以划分语句块。 2、Python序列类型包括 、、三种; 是Python中唯一的映射类型。 3、Python中的可变数据类型有,不可变数据类 型有。 4、Python的数字类型分为、、等子类型。 5、设s=‘abcdefg’,则s[3]值是 ,s[3:5]值是 , s[:5]值是…

网站html标签如何优化,网站HTML标签优化教程

真正需要SEOer掌握并经常使用的HTML标签也就那么几个&#xff0c;本小节丈哥seo带来的是页面HTML标签优化。title标签 – 标题标签1)title标签用法网站SEOHTML标签优化教程 – 丈哥seo2)标题标签的作用关于网站标题写法与操作技巧有许多&#xff0c;需要怎么优化标题的朋友可以…

hypot函数_hypot()函数与C ++中的示例

hypot函数C hypot()函数 (C hypot() function) hypot() function is a library function of cmath header, it is used to find the hypotenuse of the given numbers, it accepts two numbers and returns the calculated result of hypotenuse i.e. sqrt(x*x y*y). hypot()…

docker 磁盘问题:device or resource busy

问题&#xff1a;[roothdp-gp-dk02 ~]# docker start 01ea65845e45Error response from daemon: Cannot start container 01ea65845e45: Error getting container 01ea65845e4547be24bc3db0bc3b424faf52b8a0534eb525aa829dd9fd6081c2 from driver devicemapper: Error mounting…

axure form列表_常见的列表页如何用Axure画出来

列表页是PM画原型的时候最容易碰到的页面类型&#xff0c;那么如何快速画出并且展现交互呢&#xff1f;我们从具体的例子开始讲解其中的技巧&#xff0c;和各种不同的演变场景。希望初级PM可以通过这篇文章改进下自己的画法。列表页基本是由页面框架&#xff0c;上导航&#xf…

python中divmod_divmod()函数以及Python中的示例

python中divmodPython divmod()函数 (Python divmod() function) divmod() function is a library function, it is used to get the quotient and remainder of given values (dividend and divisor), it accepts two arguments 1) dividend and 2) divisor and returns a tup…

html 轮播图的鼠标事件,这是图片轮播的代码 html+css,怎么加上鼠标悬停移出继续功能?...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼.one {position: absolute;width: 500px;height: 400px;overflow: hidden;}.one_cantent img {width: 500px;height: 300px;float: left;}.one_cantent {width: 2500px;height: 400px;position: absolute;left: 0px;animation-name…

微软Azure云之企业Exchange 2016部署12—配置负载平衡

上几节我们把Exchange2016邮箱系统配置完毕了&#xff0c;本节我们来配置开通需要对外的端口&#xff0c;并对这些端口进行负载均衡配置&#xff0c;如下图红框所示&#xff1a;1.Exchange服务端口Exchange2016需要对外开通以下的端口&#xff0c;来对外提供不同的服务&#xf…

linux多线程求和_linux多线程pthread系列函数详解

linux多线程pthread系列函数详解(一)为什么要引入线程线程技术早在60年代就被提出&#xff0c;但是在80年代才真正使用到操作系统中。传统UNIX也支持多线程概念&#xff0c;但在一个进程中只允许有一个线程&#xff0c;这样多线程就意味着多进程。现在多线程技术已经被很多操作…

python独立log示例_带有Python示例的math.log()方法

python独立log示例Python math.log()方法 (Python math.log() method) math.log() method is a library method of math module, it is used to get the natural logarithm of a given number to base e (by default). It accepts the number and a base (which an optional) a…

搭建云计算机win10,win10电脑做云服务器

弹性云服务器 ECS弹性云服务器(Elastic Cloud Server)是一种可随时自助获取、可弹性伸缩的云服务器&#xff0c;帮助用户打造可靠、安全、灵活、高效的应用环境&#xff0c;确保服务持久稳定运行&#xff0c;提升运维效率三年低至5折&#xff0c;多种配置可选了解详情Windows远…

聚类分析在用户行为中的实例_用户关注行为数据分析过程详解-描述统计+聚类...

以下是基于一小段用户关注产品的行为数据分析过程详细描述&#xff0c;各位老师如有不同意见或优化建议&#xff0c;还请不吝赐教。一、数据大致是这样的(已经脱敏处理)二、数据预处理从年款提取出年限&#xff0c;从价格标识出价格区间&#xff0c;随便写一下SQL如下&#xff…

centos下升级jdk版本

2019独角兽企业重金招聘Python工程师标准>>> 由于安装的centos系统&#xff0c;自带了jdk1.6和1.7的版本&#xff0c;介于在平时开发&#xff0c;用了1.8.为了保持开发环境的一致&#xff0c;故此需要升级&#xff0c;放办maven打包等工具的使用。 查看系统的jdk版本…

学英语要用计算机吗,学计算机的人是否要学英语?

我记得在我大一的时候,那个时候还没有程序课呢.不过我是很喜欢计算机这个专业的,我也非常想学习编程语言,所以当时即使没有程序课,我也是借了一本VB的书回家来看.当时就在VB的贴吧乱看,大概贴吧里有一个人气很高的一位高手,写了好多文章,也帮人解决好多问题.在他的观点中,他认为…

语言之输出png图片_什么是PPML?如何输出PPML文档?

什么是PPML&#xff1f;PPML是由PODi联盟的几个会员公司共同开发出一种个性化印刷标识语言&#xff0c;这是一种全新的、基于XML(可扩展标识语言&#xff09;技术的印刷行业标准语言&#xff0c;得到越来越多的业内人士关注。PPML采用XML作为句法基础&#xff0c;使PPML其他很多…

TCP/IP协议网络模型

1.tcp/ip分层模型 tcp/ip把网络结构分为四层&#xff0c;从上到下依次为&#xff1a;应用层、传输层、互联网层、网络接口层。每层担任不同的职责&#xff0c;下层服务于上层&#xff0c;最终上层就是用户使用的层。分层结构如图1所示。 图1 tcp/ip分层模型 (1)应用层 向用户提…

c++中函数atan_atan()函数以及C ++中的示例

c中函数atanC atan()函数 (C atan() function) atan() function is a library function of cmath header, it is used to find the principal value of the arc tangent of the given number, it accepts a number (x) and returns the principal value of the arc tangent of…

我想成为计算机专业第一,我对计算机专业学生的忠告。

计算机专业的学生在面临毕业的时候有些同学应该会有这样的想法&#xff0c;我对计算机没有兴趣&#xff0c;毕业不打算从事计算机专业的对口工作&#xff1b;或者我当时选择学计算机专业是因为那时候对计算机有比较大的兴趣&#xff0c;而现在&#xff0c;越来越觉得没有意思了…

job每分钟执行 oracle_Oracle Job 每个时间点执行示例

1:每分钟执行Interval > TRUNC(sysdate,mi) 1/ (24*60)或Interval > sysdate1/14402:每天定时执行例如&#xff1a;每天的凌晨1点执行Interval > TRUNC(sysdate) 1 1/ (24)3:每周定时执行例如&#xff1a;每周一凌晨1点执行Interval >TRUNC(next_day(sysdate,星期…

c#打印程序原码_C#程序打印新行

c#打印程序原码C&#xff03;打印新行 (C# printing a new line) To print a new line within the message while printing it on the console, we can use following methods, 要在控制台上打印消息时在消息中打印新行&#xff0c;我们可以使用以下方法&#xff0c; Using \n…