I'm learning linear algebra. Please explain the following chapter about dot products and specifically planes step by step for my notes. 
3.6.2 Planes 
Planes in three dimensions (and higher) are similar to lines in two dimensions in that they both split their domain into two half-spaces. In Section 3.6.1, we saw that a two-dimensional line splits the xy-plane into a positive half-space and a negative half-space. There are also two types of representations (one implicit and one explicit) for planes, similar to lines in two dimensions. 
To define a plane on explicit form, i.e., similar to P(t) = S + td for lines, a starting point, S, and two direction vectors, d1 and d2, are needed. The direction vectors may not be collinear, i.e., di. 0 kd2 for all values of k. Another way to put it is that the direction vectors may not be parallel, not even parallel but with opposite directions. The direction vectors both lie in the plane. Hence, if a point, P, is to lie in the plane, it must hold that 
SP = tidi + t2d2, 
for some values of the scalars t1 and t2. Similar to lines, this expression is rewritten as below, where the two scalars, t1 and t2, have been set as parameters to P, i.e., 
SP(ti,t2) = tidi +t2d2 P(ti,t2) — S = tl dl + t2 d2 <=:• P(ti,t2) = S + +t2d2. 
(3.71) 
3.18 

This form is illustrated to the right as well. As can be seen, this is very similar to vector addition. The direction vectors, d1 and d2, are scaled by t1 and t2, respectively. The resulting vectors are added together with the starting point, S. This leads to the following definition. 
(3.70) 
Definition 3.8: A Parameterized Plane A plane, parameterized by t1 E R and t2 E R, can be described by a starting point, ,S, and two direction vectors, d1 and d2. All points, P(ti , t2 ), on the plane can be described by 
P(ti , t2) = S + +t2d2. 
(3.72) 
If one of d1 or d2 is 0 or if d1 and d2 are parallel (either in the same direction, or opposite), then this degrades to a parameterized line equation. 
Interestingly, there is also an implicit form of the plane equation. First, let us write out the plane equation on component form, as shown below, where du, means the y-component of d1, and so on. 
P(t1 t2 = S di t21:12 
pz(ti,t2) = sz + tl dl,y + t2d2,z, ,t2) = sy tl dl,y t2d2,1!) Pz t2 = tl dl z t2 d2 z • 
(3.73) 

Recall that for two-dimensional lines, the parameterized line: P(t) = S t td could be transformed into a line on implicit form: n • (P - 51). This was done by eliminating t, and the same can be done for Equation (3.73) above, where both t1 and t2 can be eliminated. This can be done using Gaussian elimination, and there is an example in Chapter 5 on this. Here, we simply state that Equation (3.73) above can be transformed into 
n • (P - = 0, (3.74) 
and refer to Chapter 5 for more details on how the elimination of ti and t2 was done. Note that n is the normal of the plane, i.e., it is perpendicular to any vector that lies in the plane. There is also a relationship between n and d1 & d2. This is the cross product, which is the topic of Chapter 4. 
Definition 3.9: Implicit Plane Equation A plane can be represented on implicit form by using a starting point, S. and a normal vector, n. All points, P, in the plane can then be described by 
n • (P - = 0. (3.75) 
Note that d # 0, otherwise, the expression is always zero. 
Exactly as for lines, we can also create a signed distance function as 
e(P) = n • (P - 5), (3.76) 
where e(P) = 0 when P lies in the plane. Also, e(P) > 0 when P lies on the same side of the plane as the point S -I- n, and that is called the positive half-space. Similarly, if e(P) C 0 then P lies on the same side of the plane as the point S - a That other part of the space is called the negative half-space. 
Example 3.10: Orthogonal Projection of a Point onto a Plane In this example, we will show how a point, P, can be projected orthogonally onto a plane defined by a normal, n , and a starting point, S. First, this process is shown in Interactive Illustration 3.19. 3.19 
P 
O 

IReset I 
IForward I 
• 
Backward  
Interactive Illustration 3.19: This illustration will show how a point, P (gray circle), is projected orthogonally down the a plane surface defined by a normal vector, n, and a starting point, S. The point can be moved around in this illustration. Click/touch Forward to commence the illustration. 
The expression for the projected point, Q, is simply 
Q = P - (3.77) 
where v = P - S. Since the projection formula is Pnv = ((v • n)/(1131112))n, i.e., a scalar times It, we know that n is the only vector that is used in creating Q (except for vectors involved in computing scalar values). Therefore, we know that Q will be projected along a direction orthogonal to the plane. In fact, since the projection of v onto n was used to move the point P, the point Q must also lie in the plane. However, we can also prove this by entering Q into the plane equation, i.e., testing whether n • (Q — = 0. This is done below 
n • (Q - S) =n • (P - PE,v - S) =n•(ter - P„,v) V =n • (v — Pnv) 
v • n =n v n 111111211 
"ow ir • Ll =n v n (-1111112 11 v • n , =11 V — 11) II 11112 =Il V 11.V 111142 =0 11112 
(3.78) 
Note that projecting a point (or vector) to a plane also is similar to computing the reflection vector, which is the topic of Example 3.13 below. 
Next follows an example, where both line equations and plane equations are used. Ir Example 3.11: Shadow Projection on a Plane In this example, we will assume that there is a light source located at L, and there is also a triangle with three vertex positions, 14 , i E {1, 2, 3}. The triangle will cast a shadow onto a plane, defined by a starting point, S, and a normal, n, i.e., the plane equation is: n • (P — 8) = 0 for all points, P, lying in the plane. The entire process is illustrated in Interactive Illustration 3.20, and after the reader has explored it, the math will be derived. 
3.20 T. 
Interactive Illustration 3.20: This illustration shows how a shadow, projected onto a plane, can be calculated. Initially, there is a light source (located at L), illustrated as a yellow circle, a triangle with three vertices, 3/4, and a ground plane. The plane is described as: n • (P - = 0. Click/touch Forward to commence the illustration. 
To calculate where the shadow "lands" on the plane, we need to create one ray per vertex. All three rays will start at the light source position, L, and the direction per vertex will be: di = — L, i.e., the ray direction is formed by the line segment created from the L and 3/4 . Hence, the line equations for the rays will be 
Ri(t) = L + tdi, where di = i — L, for i E {1, 2, 3}. (3.79) 
Nov, what we really are looking for is when these rays "hit" the plane, i.e., we need to set up an expression which uses the line equations, Ri (t), and the plane equation, n • (P - = 0 at the same time. Since the only points, P, that lie in the plane fulfill n • (P - 8) = 0, and because we also want those points P to lie on the line equation, we can simply replace P by Ri (t) in the plane equation and simplify the expression. This is done below. 
Ri(t) = L tcif l n (R; (t)— S) = 0 n•(P — S) = 0 <=> n•(L+tdi—S)= 0 •:=> n • (L - S) t(n • di) = 0 
(3.80) 
As can be seen, this is a first-degree polynomial in t, which has the following solution (where we now have added the subscript i to t in order to clearly show that there is one solution per triangle vertex), i.e., 
—n • (L - S) n • (S — L) n • di n • di 
(3.81) 
Division by zero must be avoided, so let us take a closer look at the denominator, n • di, which is zero only when n 1 di, which make sense, because if the ray direction is parallel to the plane, the ray cannot hit the plane at all. Alternatively, the ray may lie exactly in the plane, in which case there are an infinite number of solutions. However, this would mean that the light source would be located in the (ground) plane as well as the triangle vertex, which is not a situation that is likely to happen (at least in real life). 
Anyway, the points of intersection are calculated as Ri (ti) = L The shadow triangle is then formed from R1, R2, and R3, which is exactly what was done in order to create Interactive Illustration 3.20.