math - 如何在给定圆心、起点和终点+半径+圆心角的3D中找到沿圆弧的点?

标签 math geometry angle points

如果我有三点,可以说:

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° = cross product of start°, end°

p包含满足方程的所有点

dot product of n° and X° = 0
// ^^^ This is only for completeness, you needn't calculate it.

现在我们需要两个正交单位向量位于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 中,有两个正交单位向量 ,我们可以类推

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°。对于 0 到 109 之间的 t,我们得到 start°end° 之间的弧。

根据您的正弦/余弦实现,您需要以弧度而非度数指定角度。

关于math - 如何在给定圆心、起点和终点+半径+圆心角的3D中找到沿圆弧的点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16428444/

相关文章:

jquery - 在非表格布局中将两个圆圈居中

c++ - 寻找一个点的 "movement direction"(角度)

algorithm - 计算没有连续元素的子集总数

javascript - 使用地心坐标系计算纬度、经度和高度的距离

algorithm - 使用基本算法以任意精度计算 Pi

android - 当我尝试绘制圆圈时,屏幕上什么也没有出现

algorithm - 快轴对齐单元格遍历算法

java - 更新分位数而不是重新计算

javascript - 检查 Angular 是否在 `from` 和 `to` 之间(顺时针方向)

c++ - 如何处理计算 acos/sin/atan2 时出现的奇怪错误?