title: Plane–plane intersection
text: # Plane–plane intersection
  
  In analytic geometry, the intersection of two planes in three-dimensional space is a line.
  
  ## Formulation
  
  The line of intersection between two planes $\Pi _{1}:{\boldsymbol {n}}_{1}\cdot {\boldsymbol {r}}=h_{1}$ and $\Pi _{2}:{\boldsymbol {n}}_{2}\cdot {\boldsymbol {r}}=h_{2}$ where ${\boldsymbol {n}}_{i}$ are normalized is given by
  
      ${\boldsymbol {r}}=(c_{1}{\boldsymbol {n}}_{1}+c_{2}{\boldsymbol {n}}_{2})+\lambda ({\boldsymbol {n}}_{1}\times {\boldsymbol {n}}_{2})$
  
  where
  
      $c_{1}={\frac {h_{1}-h_{2}({\boldsymbol {n}}_{1}\cdot {\boldsymbol {n}}_{2})}{1-({\boldsymbol {n}}_{1}\cdot {\boldsymbol {n}}_{2})^{2}}}$
      $c_{2}={\frac {h_{2}-h_{1}({\boldsymbol {n}}_{1}\cdot {\boldsymbol {n}}_{2})}{1-({\boldsymbol {n}}_{1}\cdot {\boldsymbol {n}}_{2})^{2}}}.$
  
  ### Derivation
  
  This is found by noticing that the line must be perpendicular to both plane normals, and so parallel to their cross product ${\boldsymbol {n}}_{1}\times {\boldsymbol {n}}_{2}$ (this cross product is zero if and only if the planes are parallel, and are therefore non-intersecting or entirely coincident).
  
  The remainder of the expression is arrived at by finding an arbitrary point on the line. To do so, consider that any point in space may be written as ${\boldsymbol {r}}=c_{1}{\boldsymbol {n}}_{1}+c_{2}{\boldsymbol {n}}_{2}+\lambda ({\boldsymbol {n}}_{1}\times {\boldsymbol {n}}_{2})$, since $\{{\boldsymbol {n}}_{1},{\boldsymbol {n}}_{2},({\boldsymbol {n}}_{1}\times {\boldsymbol {n}}_{2})\}$ is a basis. We wish to find a point which is on both planes (i.e. on their intersection), so insert this equation into each of the equations of the planes to get two simultaneous equations which can be solved for $c_{1}$ and $c_{2}$.
  
  If we further assume that ${\boldsymbol {n}}_{1}$ and ${\boldsymbol {n}}_{2}$ are orthonormal then the closest point on the line of intersection to the origin is ${\boldsymbol {r}}_{0}=h_{1}{\boldsymbol {n}}_{1}+h_{2}{\boldsymbol {n}}_{2}$. If that is not the case, then a more complex procedure must be used.
  
  ## Dihedral angle
  
  Given two intersecting planes described by $\Pi _{1}:a_{1}x+b_{1}y+c_{1}z+d_{1}=0$ and $\Pi _{2}:a_{2}x+b_{2}y+c_{2}z+d_{2}=0$, the dihedral angle between them is defined to be the angle $\alpha$ between their normal directions:
  
      $\cos \alpha ={\frac {{\hat {n}}_{1}\cdot {\hat {n}}_{2}}{|{\hat {n}}_{1}||{\hat {n}}_{2}|}}={\frac {a_{1}a_{2}+b_{1}b_{2}+c_{1}c_{2}}{{\sqrt {a_{1}^{2}+b_{1}^{2}+c_{1}^{2}}}{\sqrt {a_{2}^{2}+b_{2}^{2}+c_{2}^{2}}}}}.$
  