问题描述
我努力学习如何计算使用XYZ点的XYZ坐标的坐标原点,水平和垂直视角和3D的距离。我可以简单地通过投影点到二维平面进行计算,但有一个更简单的方法来做到这一点的3D?
I am trying to learn how to calculate the XYZ coordinates of a point using the XYZ coordinates of an origin point, a horizontal and vertical angle, and 3d distance. I can make the calculations simply by projecting the points onto 2D planes, but is there a more straightforward way to do this in 3D?
我想了解一个测量总台计算基础上的新点位置真实测量位置,三维(斜率)的距离,它测量到一个新的点,而测量的水平和垂直角度的视线到新点位置。
I am trying to understand how a surveying total station calculates new point locations based on it's measured location, the 3d (slope) distance that it measures to a new point, and the measured horizontal and vertical angles that sight onto the new point location.
谢谢
电子
推荐答案
就在上约定注: 2D极协调经常使用(半径,THETA)
,其中 THETA
是水平或方位角度。它的范围从: THETA = 0
,二维点(X,Y)=(半径,0)
的X轴,以 THETA = 2.PI
XY平面 - 反时针方向 THETA
增大。我们的问题混淆...
Just a note on conventions: 2D polar coordinates often use (radius, theta)
, where theta
is the 'horizontal' or 'azimuth' angle. It ranges from: theta=0
, the 2D point (x,y) = (radius,0)
on the X-axis, to: theta=2.PI
on the XY plane - an anti-clockwise direction as theta
increases. Now to confuse matters...
三维球面坐标(保持右手坐标系)经常使用的坐标:(半径,THETA,PHI)
。在这种情况下, THETA
用于垂直或天顶的角度,从 THETA = 0
( Z轴),以 THETA = PI
(在-Z轴)。 披
用于方位角。
3D spherical coordinates (maintaining a right-handed coordinate system) often use coordinates: (radius, theta, phi)
. In this case, theta
is used for the 'vertical' or 'zenith' angle, ranging from theta=0
(the Z axis) to theta=PI
(the -Z axis). phi
is used for the azimuth angle.
其他文本将使用不同的约定 - 但这似乎是由物理学家和(部分)数学文本的青睐。 要紧的是,你选择一个会议并一致使用的。
Other texts will use different conventions - but this seems to be favoured by physicists and (some) mathematics texts. What matters is that you pick a convention and use it consistently.
在此之后:
半径
的:距离点。给定一个点(X,Y,Z)
直角坐标系中,我们有(勾股定理)半径: R =开方(X * X + Y * Y + Z * Z)
,例如, 0℃=半径LT; +无限
radius
: distance to the point. given an point (x,y,z)
in cartesian coordinates, we have the (pythagorean) radius: r = sqrt(x * x + y * y + z * z)
, e.g., 0 <= radius < +infinity
THETA
的:天顶角,其中 THETA = 0
的正上方(在+ Z轴),而 THETA = PI
的正下方(该-Z轴)和 THETA =π/ 2
是什么你会考虑0度的海拔,例如,
0℃= THETA&LT; = PI
theta
: the zenith angle, where theta=0
is directly above (the +Z axis), and theta=PI
is directly below (the -Z axis), and theta=PI/2
is what you would consider an 'elevation' of 0 degrees, e.g.,0 <= theta <= PI
披
的:方位角,其中披= 0
是对' ,并作为你打开(+ X轴),逆时针,披=π/ 2
(+ Y轴),披=权PI
(在-X轴),披= 3.PI / 2
(在-Y轴)和披= 2.PI
- 相当于披= 0
(回+ X轴)。例如, 0℃=披&LT; 2.PI
phi
: the azimuth angle, where phi=0
is to the 'right' (the +X axis), and as you turn 'anticlockwise', phi=PI/2
(the +Y axis), phi=PI
(the -X axis), phi=3.PI/2
(the -Y axis), and phi=2.PI
- equivalent to the phi=0
(back to the +X axis). e.g., 0 <= phi < 2.PI
伪code:(标准的数学库三角函数)
Pseudo-code: (standard math library trigonometric functions)
在(半径,THETA,PHI)
你可以找到点(X,Y,Z)
:
X =半径* SIN(THETA)* COS(PHI);
Y =半径* SIN(THETA)*罪(PHI);
Z =半径* COS(PHI);
x = radius * sin(theta) * cos(phi);
y = radius * sin(theta) * sin(phi);
z = radius * cos(phi);
相反,你可以找到一个(半径,THETA,PHI)
的在的(X,Y,Z)
:
Conversely, you can find a (radius, theta, phi)
from (x,y,z)
:
半径=开方(X * X + Y * Y + Z * Z);
THETA = ACOS(Z /半径);
披= ATAN2(Y,X);
radius = sqrt(x * x + y * y + z * z);
theta = acos(z / radius);
phi = atan2(y, x);
请注意:使用是很重要的 ATAN2
在最后的方程,的没有的反正切
!
Note: it is important to use atan2
in the final equation, not atan
!
这篇关于使用水平和垂直角度和斜距计算的三维点坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!