平面和射线交点

编程入门 行业动态 更新时间:2024-10-27 13:35:28

平面和射线<a href=https://www.elefans.com/category/jswz/34/1768934.html style=交点"/>

平面和射线交点

设平面 A x + B y + C z + D = 0 ( A 2 + B 2 + C 2 ≠ 0 ) Ax+By+Cz +D=0\left(A^2+B^2+C^2\neq 0\right) Ax+By+Cz+D=0(A2+B2+C2=0),
点 P ( P x , P y , P z ) P(P_x, P_y, P_z) P(Px​,Py​,Pz​)

(1)求点 P P P到平面距离
(2)过点 P P P作直线,方向为 ( D x , D y , D z ) \left(D_x, D_y, D_z\right) (Dx​,Dy​,Dz​),求平面与直线交点
(2)过点 P P P作射线,方向为 ( D x , D y , D z ) \left(D_x, D_y, D_z\right) (Dx​,Dy​,Dz​),求平面与直线交点

解:
(1)这个高中有学过
∣ A P x + B P y + C P z + D ∣ A 2 + B 2 + C 2 \frac{\left|AP_x+BP_y+CP_z +D\right|}{\sqrt{A^2+B^2+C^2}} A2+B2+C2 ​∣APx​+BPy​+CPz​+D∣​

(2)为了方便,平面法向量 n = ( A , B , C ) \mathbf{n} = \left(A,B,C\right) n=(A,B,C)
直线方向向量 d = ( D x , D y , D z ) \mathbf{d} = \left(D_x,D_y,D_z\right) d=(Dx​,Dy​,Dz​)
直线上的点可以表示为 P + t d P+t\mathbf{d} P+td,其中 t ∈ R t\in \mathbb{R} t∈R

1.若 n ⋅ d ≠ 0 \mathbf{n}\cdot \mathbf{d}\neq 0 n⋅d=0,则直线和平面有且仅有1个交点
由于 P + t d P+t\mathbf{d} P+td在平面上,因此
n ⋅ ( P + t d ) + D = 0 ⇒ t = − D + n ⋅ P n ⋅ d \mathbf{n}\cdot\left(P+t\mathbf{d}\right) +D = 0\Rightarrow t= -\frac{D + \mathbf{n}\cdot P}{\mathbf{n}\cdot \mathbf{d}} n⋅(P+td)+D=0⇒t=−n⋅dD+n⋅P​
进而交点坐标
P + t d = P − D + n ⋅ P n ⋅ d d = ( P x − ( A P x + B P y + C P z + D ) A D x + B D y + C D z D x P y − ( A P x + B P y + C P z + D ) A D x + B D y + C D z D y P z − ( A P x + B P y + C P z + D ) A D x + B D y + C D z D z ) \begin{aligned} P+t\mathbf{d} & = P -\frac{D + \mathbf{n}\cdot P}{\mathbf{n}\cdot \mathbf{d}}\mathbf{d}\\ &=\begin{pmatrix}P_x - \frac{\left(AP_x+BP_y +CP_z+D\right)}{AD_x +BD_y+CD_z}D_x\\ P_y - \frac{\left(AP_x+BP_y +CP_z+D\right)}{AD_x +BD_y+CD_z}D_y\\ P_z - \frac{\left(AP_x+BP_y +CP_z+D\right)}{AD_x +BD_y+CD_z}D_z\\ \end{pmatrix} \end{aligned} P+td​=P−n⋅dD+n⋅P​d= ​Px​−ADx​+BDy​+CDz​(APx​+BPy​+CPz​+D)​Dx​Py​−ADx​+BDy​+CDz​(APx​+BPy​+CPz​+D)​Dy​Pz​−ADx​+BDy​+CDz​(APx​+BPy​+CPz​+D)​Dz​​ ​​

2.若 n ⋅ d = 0 \mathbf{n}\cdot \mathbf{d}= 0 n⋅d=0,且 n ⋅ P + d = 0 \mathbf{n}\cdot P +d = 0 n⋅P+d=0,则直线与平面重合
3.若 n ⋅ d = 0 \mathbf{n}\cdot \mathbf{d}= 0 n⋅d=0,且 n ⋅ P + d ≠ 0 \mathbf{n}\cdot P +d \neq 0 n⋅P+d=0,则直线与平面无交点

(3)与(2)类似
射线上的点可以表示为 P + t d P+t\mathbf{d} P+td,其中 t ∈ R + t\in \mathbb{R}_{+} t∈R+​
依然可以得到 t = − D + n ⋅ P n ⋅ d t= -\frac{D + \mathbf{n}\cdot P}{\mathbf{n}\cdot \mathbf{d}} t=−n⋅dD+n⋅P​

1.若 n ⋅ d ≠ 0 \mathbf{n}\cdot \mathbf{d}\neq 0 n⋅d=0且 t < 0 t<0 t<0则无交点
2.若 n ⋅ d ≠ 0 \mathbf{n}\cdot \mathbf{d}\neq 0 n⋅d=0且 t ≥ 0 t\ge0 t≥0,则只有一个交点
P + t d = P − D + n ⋅ P n ⋅ d d = ( P x − ( A P x + B P y + C P z + D ) A D x + B D y + C D z D x P y − ( A P x + B P y + C P z + D ) A D x + B D y + C D z D y P z − ( A P x + B P y + C P z + D ) A D x + B D y + C D z D z ) \begin{aligned} P+t\mathbf{d} & = P -\frac{D + \mathbf{n}\cdot P}{\mathbf{n}\cdot \mathbf{d}}\mathbf{d}\\ &=\begin{pmatrix}P_x - \frac{\left(AP_x+BP_y +CP_z+D\right)}{AD_x +BD_y+CD_z}D_x\\ P_y - \frac{\left(AP_x+BP_y +CP_z+D\right)}{AD_x +BD_y+CD_z}D_y\\ P_z - \frac{\left(AP_x+BP_y +CP_z+D\right)}{AD_x +BD_y+CD_z}D_z\\ \end{pmatrix} \end{aligned} P+td​=P−n⋅dD+n⋅P​d= ​Px​−ADx​+BDy​+CDz​(APx​+BPy​+CPz​+D)​Dx​Py​−ADx​+BDy​+CDz​(APx​+BPy​+CPz​+D)​Dy​Pz​−ADx​+BDy​+CDz​(APx​+BPy​+CPz​+D)​Dz​​ ​​

3.若 n ⋅ d = 0 \mathbf{n}\cdot \mathbf{d}= 0 n⋅d=0,且 n ⋅ P + d = 0 \mathbf{n}\cdot P +d = 0 n⋅P+d=0,则直线与平面重合
4.若 n ⋅ d = 0 \mathbf{n}\cdot \mathbf{d}= 0 n⋅d=0,且 n ⋅ P + d ≠ 0 \mathbf{n}\cdot P +d \neq 0 n⋅P+d=0,则直线与平面无交点

参考:

更多推荐

平面和射线交点

本文发布于:2023-11-15 21:25:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606601.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:交点   射线   平面

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!