3D Perpendicular Point on Line From 3D point

前端 未结 4 928
北恋
北恋 2020-12-09 12:33

This question has been asked before in reference to 2D. This question extends it to 3D. How do I find the perpendicular intersected point on a line from a point in 3D space?

4条回答
  •  暖寄归人
    2020-12-09 12:47

    I did the calculation for the answer marked as Best Answer:
    let alpha = [(x3-x1)(x2-x1) + (y3-y1)(y2-y1) + (z3-z1)(z2-z1)] / [(x2-x1)(x2-x1) + (y2-y1)(y2-y1) + (z2-z1)(z2-z1)]
    point of intersection = (x1+alpha*(x2-x1), y1+alpha*(y2-y1), z1+alpha*(z2-z1)).

提交回复
热议问题