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.pswp.cn/news/542966.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/542966.shtml
英文地址,請注明出處:http://en.pswp.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…