给定四面体上的三个点,找到第四个点
如果 3D 空间中有一个等边三角形,其中所有边的长度均为 1,则可以使用两个点来形成四面体。一个浮在三角形前面,一个浮在三角形后面。给定三个已知顶点的坐标,您将如何计算可能的第四个顶点?
如果您能展示如何使用处理向量类定义,我将非常感激
If you have an equilateral triangle in 3D space, where all the sides are of length 1, there are two points that you could use to form a tetrahedron. One floating out in front of the triangle, and one behind it. Given the coordinates of the three known vertices, how would you calculate either of the possible fourth vertices?
I would really appreciate it if you can show how to do it with the Processing vector class definition
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
平均三个点以获得三角形的中心:
通过取其中两条边的叉积来计算法线向量:
标准化法线向量(使其具有单位长度):
按正四面体的高度缩放法线:
现在,你的两点是:
Average your three points to get the center of the triangle:
Calculate the normal vector by taking the cross product of two of the sides:
Normalize the normal vector (make it of unit length):
Scale the normal by the height of regular tetrahedron:
Now, your two points are:
(a + b + c)/3
(三角形的中心)+/- ((ab) x (bc)
(三角形两条边的叉积,因此垂直于两者)*某个常数或其他)
(正四面体的高度除以叉积的长度,长度为 1 * 1 * sin(60 度) = sqrt(3 )/2)这或许可以简化。
[编辑:高度为 sqrt(2/3),因此常量为
2*sqrt(2)
][第二次编辑:不在前三个点的平面内的任何第四点形成四面体。 ITYM 一个正四面体 ;-)]
(a + b + c)/3
(centre of the triangle)+/- ((a-b) x (b-c)
(cross product of two sides of the triangle, hence perpendicular to both)* some constant or other)
(the height of a regular tetrahedron divided by the length of that cross product, the length being 1 * 1 * sin(60 degrees) = sqrt(3)/2)This can probably be simplified.
[Edit: height is sqrt(2/3), so the constant is
2*sqrt(2)
][Second edit: any fourth point not in the plane of the first three forms a tetrahedron. ITYM a regular tetrahedron ;-)]
因为,3D从来都不是我的兴趣,我想我只能提供一种方法来做到这一点,而不是精确的坐标。
Since, 3D has never been my interest, I guess I can only provide a way to do this, rather than exact coordinates.