绘制一个半圆弧轨迹给出两个端点(3D) [英] plotting a semi circular path given two end points (3D)
问题描述
假设像大地球形物体。说我有两个端点3D,在那里我目前在哪里我想去的地方。我想要构造在大气中的路径 - 某种半圆形路径来内插从一点到另一点。 在 http://workshop.chromeexperiments.com/projects/armsglobe/ <像一个地球上的路径/ A>
Assume a Spherical object like earth. Say I have two end points 3D, where I am currently and where I wanted to go. I want to construct a path in the atmosphere - some kind of a semi-circular path to interpolate from one point to another. a path on the earth like the one in http://workshop.chromeexperiments.com/projects/armsglobe/
下一位置是基于当前位置来计算。已经有人做了数学,需要先?
The next position is computed based on current position. Has someone done the math for it before?
推荐答案
1.sphere状物体
1.sphere-like object
- 您的意思是椭圆形
- 在旋转轴= Z
- 在赤道平面的XY =
- 使用球面坐标系
-
如P(A,B,H)A =&LT; 0,2PI>,B =&LT; -PI,+ PI>,H =℃下,+ INF> ...高度以上的表面
- you mean ellipsoid
- rotation axis = Z
- equator plane = XY
- use spherical coordinate system
like P(a,b,h) a=<0,2PI>, b=<-PI,+PI>, h=<0,+inf> ... height above surface
r=(Re+h)*cos(b);
x=r*cos(a);
y=r*sin(a);
z=(Rp+h)*sin(b);
Rp为椭球极半径(中心与顶点之间的Z轴)
Rp is polar radius of ellipsoid (between center and pole on Z axis)
2点之间2.curve路径
2.curve path between 2 points
- 现在,你有P0,P1的三维点
- 将其转换为球面坐标,所以你必须
- P0(A0,B0,H0)
- P1(A1,B1,H1)
- 在我假设H = 0
-
现在只需插P(A,B,H)
- now you have P0,P1 3D points
- convert them into spherical coordinates so you have
- P0(a0,b0,h0)
- P1(a1,b1,h1)
- I assume h=0
now just interpolate P(a,b,h)
a=a0+(a1-a0)*t
b=b0+(b1-b0)*t
h=h0+(h1-h0)*t
这会在表面上创建路径
this will create path on the surface
,使其上面只是一些曲线添加到h这样的:
to make it above just add some curve to h like this:
h=h0+(h1-h0)*t+H*cos(PI*t)
H为最大高度高于表面
H is max height above surface
这篇关于绘制一个半圆弧轨迹给出两个端点(3D)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!