我想计算正四面体的第四个顶点。我有坐标
{0,0,Sqrt[2/3]-1/(2sqrt[6](},{-(1/(2sQRt[3]((,-(1/2(,-Sqrt[6]((}和{-(1/(2sqrt[3]((,1/2,-(1/2(2sqrt[6]((}
有人能帮忙吗?
查找面的中心
cx = (x1 + x2 + x3)/3 and similar for y,z
获取两个边缘向量
e2x = x2 - x1
e2y = y2 - y1
e2z = z2 - z1
e3x = x3 - x1
e3y = y3 - y1
e3z = z3 - z1
计算边缘长度
elen = sqrt(e2x*e2x+e2y*e2y+e2z*e2z)
计算矢量乘积以获得该面的法线
nx = e2y*e3z - e2z*e3y
ny = e2z*e3x - e2x*e3z
nz = e2x*e3y - e2y*e3x
使机组正常
nlen = sqrt(nx*nx+ny*ny+nz*nz)
nx = nx / nlen
...
使所需长度(四面体高度(的法线
lnx = nx * sqrt(2/3) * elen
...
将此法线添加到面中心
x4 = cx +/- lnx
y4 = cy +/- lny
z4 = cz +/- lnz
CCD_ 1符号对应于第四顶点的两个可能位置