Vectors and Geometry in 3D Space
What You’ll Learn
Section titled “What You’ll Learn”In this lesson you’ll extend vectors from 2D to 3D, learn the dot product and cross product, and see how to describe lines and planes in three-dimensional space.
The Concept
Section titled “The Concept”Vectors in 3D
Section titled “Vectors in 3D”A vector in 3D has three components
Its magnitude (length) is
This is just the Pythagorean theorem extended to three dimensions.
The Dot Product
Section titled “The Dot Product”The dot product of two vectors gives a scalar (a number, not a vector)
It’s also equal to
where theta is the angle between the vectors. Two vectors are perpendicular (orthogonal) when their dot product is zero.
The Cross Product
Section titled “The Cross Product”The cross product of two vectors gives a new vector that is perpendicular to both
The magnitude of the cross product equals the area of the parallelogram formed by the two vectors
The direction follows the right-hand rule: point your fingers along u, curl them toward v, and your thumb points in the direction of u cross v.
Lines and Planes
Section titled “Lines and Planes”A line through point P₀ in the direction of vector v is
A plane with normal vector n = (a, b, c) passing through point (x₀, y₀, z₀) is
Worked Examples
Section titled “Worked Examples”Example 1: Dot product and angle between vectors
Let u = (1, 2, 3) and v = (4, -1, 2). Find the angle between them.
The vectors make an angle of about 62 degrees. Since the dot product is positive, the angle is acute (less than 90 degrees).
Example 2: Cross product
Find u x v for u = (1, 2, 3) and v = (4, -1, 2).
We can verify this is perpendicular to both original vectors by checking the dot products
Both dot products are zero, confirming the cross product is perpendicular to both vectors.
The blue arrow is u = (1, 2, 3), the green arrow is v = (4, -1, 2), and the orange arrow is their cross product (7, 10, -9). Notice how the orange vector sticks straight out of the parallelogram formed by u and v. That’s the cross product doing its thing.
Here’s the same thing flattened into 2D (looking at just the x and y components) so you can see the vectors, the parallelogram, and the angle between them without needing to rotate anything.
The 3D version above lets you see how the cross product points out of the plane. The 2D version here shows the parallelogram and angle more clearly. Both views together give you the full picture.
Example 3: Equation of a plane
Find the equation of the plane containing the points A = (1, 0, 0), B = (0, 1, 0), and C = (0, 0, 1).
First, find two vectors in the plane
The normal vector is their cross product
Using point A = (1, 0, 0) and normal n = (1, 1, 1)
This makes geometric sense: the plane passes through the three axis intercepts at distance 1 from the origin.
Real-World Application
Section titled “Real-World Application”3D vectors and geometry are the backbone of:
- Game engines use vectors for position, velocity, forces, camera direction, and lighting calculations
- The cross product computes surface normals, which determine how light bounces off objects
- The dot product is used for view frustum culling (checking if objects are in front of the camera)
- Plane equations define collision boundaries, clipping planes, and portals
- Robotics uses 3D vectors for joint positions and end-effector orientation