给定四面体上的三个点,找到第四个点

发布于 2024-10-06 05:18:08 字数 207 浏览 3 评论 0原文

如果 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

绅士风度i 2024-10-13 05:18:08

平均三个点以获得三角形的中心:

center = (a + b + c) / 3

通过取其中两条边的叉积来计算法线向量:

normal = (c - a) x (b - a)

标准化法线向量(使其具有单位长度):

unit_normal = normal / |normal|

按正四面体的高度缩放法线:

scaled_normal = unit_normal * sqrt(2/3)

现在,你的两点是:

top = center + scaled_normal
bottom = center - scaled_normal

Average your three points to get the center of the triangle:

center = (a + b + c) / 3

Calculate the normal vector by taking the cross product of two of the sides:

normal = (c - a) x (b - a)

Normalize the normal vector (make it of unit length):

unit_normal = normal / |normal|

Scale the normal by the height of regular tetrahedron:

scaled_normal = unit_normal * sqrt(2/3)

Now, your two points are:

top = center + scaled_normal
bottom = center - scaled_normal
挽清梦 2024-10-13 05:18:08

(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 ;-)]

秋风の叶未落 2024-10-13 05:18:08

因为,3D从来都不是我的兴趣,我想我只能提供一种方法来做到这一点,而不是精确的坐标。

距离为
从质心算起的 sqrt(2/3)
三角形和在一条垂直线上
到三角形形成的平面
并包含质心。

Since, 3D has never been my interest, I guess I can only provide a way to do this, rather than exact coordinates.

A point which lies at a distance of
sqrt(2/3) from the centroid of the
triangle and on a line perpendicular
to the plane formed by the triangle
and containing the centroid.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文