Two dimensions become three, and one new operation — the scalar product — turns out to answer nearly every question about angle and perpendicularity.
Vectors in three dimensions
A vector in space is written in component form or in unit vector form:
a=23−1=2i+3j−k
where i, j and k are unit vectors along the x, y and z axes.
Addition, subtraction and scalar multiples work componentwise, exactly as in two dimensions:
(2i+3j−k)+(i−2j+4k)=3i+j+3k
And travelling between points is unchanged:
AB=OB−OA
Magnitude and unit vectors
∣a∣=x2+y2+z2
∣3i+4j−12k∣=9+16+144=169=13
A unit vector has magnitude 1. To find the unit vector in the direction of a, divide by the magnitude:
a^=∣a∣a
The unit vector along 3i+4j is 51(3i+4j), since the magnitude is 5.
The scalar product
a⋅b=a1b1+a2b2+a3b3
For a=2i+3j−k and b=i−2j+4k:
a⋅b=(2)(1)+(3)(−2)+(−1)(4)=2−6−4=−8
Two useful facts:
a⋅a=∣a∣2a⋅b=0⟺a and b are perpendicular
(assuming neither is the zero vector).
Are 2i+3j−k and i−j−k perpendicular?
(2)(1)+(3)(−1)+(−1)(−1)=2−3+1=0
Yes.
The angle between two vectors
a⋅b=∣a∣∣b∣cosθ⇒cosθ=∣a∣∣b∣a⋅b
Find the angle between a=2i+3j−k and b=i−2j+4k.
a⋅b=−8∣a∣=14∣b∣=21
cosθ=1421−8=294−8=−0.4666
θ=117.8° (1 d.p.)
The vector equation of a line
A line is fixed by one point on it and one direction along it:
r=a+td
where a is the position vector of a known point, d is the direction vector, and t is a parameter running over all real numbers.
The line through (1,2,3) in the direction 2i−j+4k:
r=(i+2j+3k)+t(2i−j+4k)
Splitting into components gives the parametric equations:
x=1+2ty=2−tz=3+4t
Through two points A and B? Take a=OA and d=AB=b−a.
Relationships between lines
In three dimensions, two lines are:
Parallel — their direction vectors are scalar multiples of each other.
Intersecting — not parallel, and there exist parameter values giving the same point.
Skew — neither parallel nor intersecting. This possibility exists only in 3D; two non-parallel lines in a plane must meet.
To test for intersection, set the two vector equations equal and solve the resulting component equations. Two of the three will determine the parameters; the third must then be satisfied. If it is not, the lines are skew.
The angle between two intersecting lines is the angle between their direction vectors, found with the scalar product as above.