使用水平和垂直角度和斜距计算 3D 点坐标 [英] Calculate 3D point coordinates using horizontal and vertical angles and slope distance
问题描述
我正在尝试学习如何使用原点的 XYZ 坐标、水平和垂直角度以及 3d 距离来计算点的 XYZ 坐标.我可以简单地通过将点投影到 2D 平面上来进行计算,但在 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?
我试图了解测量全站仪如何根据其测量位置、它测量到新点的 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.
谢谢,
E
推荐答案
关于约定的说明:2D polar坐标经常使用(radius, theta)
,其中theta
是'水平'或'方位'角.它的范围从:theta=0
,X 轴上的二维点(x,y) = (radius,0)
,到: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...
3D 球面坐标(保持右手坐标系)经常使用坐标:(半径,θ,phi)
.在这种情况下,theta
用于垂直"或天顶"角度,范围从 theta=0
(Z 轴)到 theta=PI
(-Z 轴).phi
用于方位角.
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.
按照这个:
radius
:到点的距离.给定笛卡尔坐标中的一个点 (x,y,z)
,我们有(勾股)半径:r = sqrt(x * x + y * y + z * z)
,例如 0 <= radius <+无穷大
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=PI/2
是您认为 0 度的仰角",例如,0 <= theta <= 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
phi
:方位角,其中 phi=0
是右"(+X 轴),当你'逆时针',phi=PI/2
(+Y轴),phi=PI
(-X轴),phi=3*PI/2
(-Y 轴)和 phi=2*PI
- 相当于 phi=0
(回到 +X 轴).例如,0 <= phi <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
伪代码:(标准数学库三角函数)
Pseudo-code: (standard math library trigonometric functions)
从 (radius, theta, phi)
你可以找到点 (x,y,z)
:
From (radius, theta, phi)
you can find the point (x,y,z)
:
x = 半径 * sin(theta) * cos(phi);
y = 半径 * sin(theta) * sin(phi);
z = 半径 * cos(theta);
相反,你可以找到一个 (radius, theta, phi)
from (x,y,z)
:
Conversely, you can find a (radius, theta, phi)
from (x,y,z)
:
radius = sqrt(x * x + y * y + z * z);
theta = acos(z/radius);
phi = atan2(y, x);
注意:在决赛中使用 atan2
很重要等式,不是 atan
!
Note: it is important to use atan2
in the final equation, not atan
!
这篇关于使用水平和垂直角度和斜距计算 3D 点坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!