lionyoyo 发表于 2008-12-4 13:46:00

求空间一点在平面上的投影,非常感谢

已知三点A(x1 y1 z1),B(x2 y2 z2),C(x3 y3 z3)确定一个平面,求点P(xp yp zp)在面ABC上的投影,及面ABC的过点P的垂线,谢谢!

chenjun_nj 发表于 2008-12-4 15:59:00

要是不怕麻烦,就按下面的步骤计算:<br/>过A、B、C三点的平面方程为<br/>((y2-y1)(z3-z1)-(y3-y1)(z2-z1))(x-x1)+((x3-x1)(z2-z1)-(x2-x1)(z3-z1))(y-y1)+((x2-x1)(y3-y1)-(x3-x1)(y2-y1))(z-z1)=0<br/>那么过P点与ABC面垂直的直线方程为(两个等式)<br/>(x-xp)/((y2-y1)(z3-z1)-(y3-y1)(z2-z1))=(y-yp)/((x3-x1)(z2-z1)-(x2-x1)(z3-z1))=(z-zp)/((x2-x1)(y3-y1)-(x3-x1)(y2-y1))<br/>三式求出交点。

nonsmall 发表于 2008-12-4 16:03:00

<p>nonsmall已经实现的算法:</p><p>根据棱锥体积公式:</p><p>V=(1/6)×&brvbar;x1x2x3x4&brvbar;&brvbar;y1y2y3y4&brvbar;&brvbar;z1z2z3z4&brvbar;</p><p>其中四个点的坐标分别为(x1,y1,z1),(x2,y2,z2),(x3,y3,z3),(x4,y4,z4)简单的说就任意取三个点为底,1/3(底*高)就是体积附一个三角型面积公式</p><p>上面是个4阶行列式 展开后得到体积</p><p>根据棱锥体积和平面ABC的面积(没记错的话是海伦公式)求高度h</p><p><font face="宋体">海伦公式:利用两点之间距离公式,求出三角形的三边长a,b,c后,令p = (a+b+c)/2。再套入以下公式就可以求出三角形的面积S :</font></p><p><font face="宋体">S = sqrt(p*(p-a)*(p-b)*(p-c))</font></p><p>根据高度h 点P ABC计算获得垂足即可</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |1 &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; 1| <br/>V=(1/6) &nbsp; ×&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|x1 &nbsp; &nbsp; x2 &nbsp; &nbsp; x3 &nbsp; &nbsp; x4| <br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |y1 &nbsp; &nbsp; y2 &nbsp; &nbsp; y3 &nbsp; &nbsp; y4| <br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |z1 &nbsp; &nbsp; z2 &nbsp; &nbsp; z3 &nbsp; &nbsp; z4| <br/>其中四个点的坐标分别为(x1,y1,z1),(x2,y2,z2),(x3,y3,z3),(x4,y4,z4) <br/><br/>简单的说就任意取三个点为底,1/3(底*高)就是体积 <br/><br/>附一个三角型面积公式: <br/><br/>S=(1/2)*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; 1 &nbsp; &nbsp; 1 &nbsp; &nbsp; 1| <br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |x1 &nbsp; x2 &nbsp; x3| <br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |y1 &nbsp; y2 &nbsp; y3| </p>
页: [1]
查看完整版本: 求空间一点在平面上的投影,非常感谢