# 2.4. 直线与平面

## 2.4. 直线与平面

#### 2.4.1. 直线与平面的夹角

$\alpha = \arccos \left| {\frac{{\vec n \cdot \vec d}}{{\left\| {\vec n} \right\| \cdot \left\| {\vec d} \right\|}}} \right| \tag{2.13}$

$\theta = \frac{\pi }{2} – \arccos \left| {\frac{{\vec n \cdot \vec d}}{{\left\| {\vec n} \right\| \cdot \left\| {\vec d} \right\|}}} \right| \tag{2.14}$

$\theta = \frac{\pi }{2} – \arccos \left| {\vec n \cdot \vec d} \right| \tag{2.15}$

#### 2.4.2. 直线与平面的交

\begin{eqnarray*}
\vec n \cdot \left( {Q + \vec dt} \right) + d = 0
\tag{2.16}
\end{eqnarray*}

\begin{eqnarray*}
t = \frac{{ – (\vec n \cdot Q + d)}}{{\vec n \cdot \vec d}}
\tag{2.17}
\end{eqnarray*}

$Y = Q – \frac{{\vec n \cdot Q + d}}{{\vec n \cdot \vec d}}\vec d \tag{2.18}$

return ({PARALLEL, OVERLAPPING, INTERSECTING})
1.    $$delta = \vec d \cdot \vec n$$;
2.    $$dist = \vec n \cdot Q + d$$;
3.    if $$delta = = 0$$, then
4.           $$Y = Q – (dist/delta) \cdot \vec d$$;
5.           return INTERSECTING;
6.    else
7.           if $$dist = = 0$$, then
8.                  return OVERLAPPING;
9.           else
10.                 return PARALLEL;
11.          end if;
12.   end if;

$L(t) = {Q_0} + ({Q_1} – {Q_0})t \tag{2.19}$