当前位置:网站首页>Definition of polar angle and its code implementation
Definition of polar angle and its code implementation
2022-06-12 09:04:00 【Little wish】
Definition of polar angle

As shown in the figure , In polar coordinates , Every point M, Can use its distance from the origin O Distance of ρ \rho ρ and OM And x Angle between axes θ \theta θ Sole determination .M The polar coordinates of are ( ρ , θ ) (\rho,\theta) (ρ,θ), among θ \theta θ Is the polar angle .
Calculation of polar angle
set up M The coordinates of the point in the rectangular coordinate system are ( x , y ) (x,y) (x,y), origin O The coordinates of the for ( 0 , 0 ) (0,0) (0,0), Then there is the following equation relation with polar coordinates :
{ ρ = x 2 + y 2 tan ( θ ) = y x ( x ≠ 0 ) \begin{cases} \rho = x^2 + y ^ 2 \\ \tan(\theta) = \frac y x (x \neq 0)\end{cases} { ρ=x2+y2tan(θ)=xy(x=0) or { x = ρ cos ( θ ) y = ρ sin ( θ ) \begin{cases} x = \rho \cos(\theta) \\ y = \rho \sin(\theta) \end{cases} { x=ρcos(θ)y=ρsin(θ)
therefore , Polar angle θ = arctan ( y x ) \theta=\arctan(\frac y x) θ=arctan(xy)
Code implementation
Use java.lang.Math Of atan2 function , For point M ( x , y ) (x,y) (x,y), It is the same as the origin O ( 0 , 0 ) (0,0) (0,0) Polar angle of θ = M a t h . a t a n 2 ( y , x ) \theta = Math.atan2(y, x) θ=Math.atan2(y,x)
public static double atan2(double y, double x)
If O The coordinates of the for ( x 0 , y 0 ) (x_0,y_0) (x0,y0), spot M ( x , y ) (x,y) (x,y) And O The polar angle of is θ = M a t h . a t a n 2 ( y − y 0 , x − x 0 ) \theta = Math.atan2(y-y_0, x-x_0) θ=Math.atan2(y−y0,x−x0)
边栏推荐
- Does database and table splitting cause reading diffusion problems? How to solve it?
- Chapter 7 - more flexible location of memory addresses
- Domain name mapping to specified IP
- Jenkins Pipeline 语法
- Analysis of 43 cases of MATLAB neural network: Chapter 8 prediction of GRNN Network - Freight Volume Prediction Based on generalized regression neural network
- Machine learning notes - circular neural network memo list
- Binary tree calculation problem
- Source code and scheme for target recognition, detection and 6D attitude estimation (the most advanced method and data set)
- Popular understanding of time domain sampling and frequency domain continuation
- Can you migrate backwards before the first migration in the south- Can you migrate backwards to before the first migration in South?
猜你喜欢

ERROR 1630 (42000): FUNCTION a.avg does not exist. Check the ‘Function Name Parsing and Resolution‘

Filters and listeners

Building a cluster: and replacing with error
![Sword finger offer:[day 8 dynamic planning (simple)] --- > frog jumping on steps](/img/0a/65bc44850e52204af278e50a8f86eb.jpg)
Sword finger offer:[day 8 dynamic planning (simple)] --- > frog jumping on steps

机器学习笔记 - 循环神经网络备忘清单

Union selector

mySql学习记录——二、mySql建表命令
![[character set 7] what are the wide character codes and multi byte codes of Chinese characters](/img/8c/6d375d90234e6094b6930c2cefefa1.png)
[character set 7] what are the wide character codes and multi byte codes of Chinese characters

《MATLAB 神經網絡43個案例分析》:第7章 RBF網絡的回歸--非線性函數回歸的實現

IDEA新版UI申请方法+无测试资格使用方法及相关介绍
随机推荐
长安链节点证书、角色、权限管理介绍
(JS) three digits are separated by commas, and two decimal places are reserved (or rounded)
Top command meaning
Regularization to limit the number of digits after the decimal point of an input number
EIP-1559
Display the remaining valid days according to the valid period
day5-x
【字符集六】宽字符串和多字节字符互转
mySql学习记录——三、mysql查询语句
Introduction to applet cloud development -- questionnaire evaluation applet practice (7)
ISCSI详解(五)——ISCSI客户端配置实战
Node sample background setup
Background color translucent
Notes used by mqtt (combined with source code)
Random acquisition of 4-digit non repeated verification code
Offer:[day 8 dynamic planning (simple)] --- > maximum profit of stock
The difference between deep copy and shallow copy
Use NVM to dynamically adjust the nodejs version to solve the problem that the project cannot be run and packaged because the node version is too high or too low
Flink CheckPoint : Exceeded checkpoint tolerable failure threshold
Analysis of 43 cases of MATLAB neural network: Chapter 8 prediction of GRNN Network - Freight Volume Prediction Based on generalized regression neural network