当前位置:网站首页>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)
边栏推荐
- sql中的Exists用法
- 2022 melting welding and thermal cutting test questions and answers
- JS to refresh the page after loading
- Binlog in mysql:
- POI library update excel picture
- [character set 9] will GBK be garbled when copied to unicode?
- Redis installation test
- Knowledge points of 2022 system integration project management engineer examination: project cost management
- MFS explanation (IV) -- MFS management server installation and configuration
- 重启Kubernetes Pod的几种方式
猜你喜欢

2022 safety officer-c certificate special operation certificate examination question bank and simulation examination
![(node:22344) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permit](/img/c1/d56ec09663857afa52f20848aeadac.png)
(node:22344) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permit

【无标题】Task3 多路召回

ERROR 1630 (42000): FUNCTION a.avg does not exist. Check the ‘Function Name Parsing and Resolution‘
![[advanced pointer I] character array & array pointer & pointer array](/img/ea/150b2162e4e1641eee7e852935d101.png)
[advanced pointer I] character array & array pointer & pointer array

2022 simulated examination platform operation of high voltage electrician work license question bank

Building a cluster: and replacing with error

Filters and listeners

43 cas d'analyse du réseau neuronal MATLAB: chapitre 7 régression du réseau RBF - - réalisation de la régression fonctionnelle non linéaire

About weights exercise
随机推荐
top命令含义
[sklearn] lightgbm
Implementing architecture caching in MySQL under redis server environment
Background position - mixed units
xshell启动遇到“由于找不到mfc110.dll,无法继续执行代码的解决方法”
mySql学习记录——三、mysql查询语句
Background position position NOUN
Flink传入自定义的参数或配置文件
About weights exercise
Summary of common character sets
《MATLAB 神經網絡43個案例分析》:第7章 RBF網絡的回歸--非線性函數回歸的實現
Analysis of 43 cases of MATLAB neural network: Chapter 8 prediction of GRNN Network - Freight Volume Prediction Based on generalized regression neural network
Method to limit the input box to only numbers
Several ways to restart kubernetes pod
Detailed explanation of iSCSI (V) -- actual operation of iSCSI client configuration
Box model border
POI library update excel picture
IDEA新版UI申请方法+无测试资格使用方法及相关介绍
Flink CheckPoint : Exceeded checkpoint tolerable failure threshold
[advanced pointer I] character array & array pointer & pointer array