如果我有三点,可以说:
start: (14.5, 10.1, 2.8)
end: (-12.3, 6.4, 7.7)
center: (0, 0, 0)
以及已确定的以下附加信息:
Radius: 15
Center Angle: 109 degrees
Arc (from Pt A - Pt B): 29
如何沿着起点和终点之间的弧找到点?
最佳答案
更新:向量标有°。
圆(或圆弧)所在平面p的法线n°为
n° = cross product of start°, end°
p包含满足方程的所有点X°
dot product of n° and X° = 0
// ^^^ This is only for completeness, you needn't calculate it.
现在我们需要两个正交单位向量X°、Y°位于p中:
X° = start° / norm(start°)
Y° = cross_prod(n°, start°) / norm(cross_prod(n°, start°))
(where norm(X°) is sqrt(x[1]^2 + x[2]^2 + x[3]^2),
and by dividing a vector V° by a scalar S I mean dividing each vector component by S:
V° / S := (V°[1]/S, V°[2]/S, V°[3]/S)
)
在二维坐标中,我们可以通过参数化绘制一个圆
t -> 15*(cos(t), sin(t)) = 15*cos(t) * X° + 15*sin(t) * Y°
where X° = (1, 0) and Y° = (0, 1).
现在在 3d 平面 p 中,有两个正交单位向量 X° 和 Y°,我们可以类推
t -> 15*cos(t) * X° + 15*sin(t) * Y°
where X°, Y° as defined before, and t goes from 0 to 109 degrees.
对于t=0,我们得到点start°。对于t=109,我们应该得到end°。如果出现问题,请将 Y° 更改为 -Y°。对于 0 到 109 之间的 t,我们得到 start° 和 end° 之间的弧。
根据您的正弦/余弦实现,您需要以弧度而非度数指定角度。
关于math - 如何在给定圆心、起点和终点+半径+圆心角的3D中找到沿圆弧的点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16428444/