1.2 Unit Direction Vectors and Scalar Dot-Product Projections
Once a dataset is centered at the origin, how do we mathematically project a -dimensional data vector onto a candidate 1D line? The answer lies in the marriage of unit direction vectors and the Euclidean dot product.
In linear algebra, the dot product measures how much two vectors point in the same direction. When is normalized to unit length (), the dot product acts as a precision laser ruler: it directly outputs the signed coordinate of the perpendicular shadow of along the axis .
In this Article
1. Normalizing a Direction Vector to Unit Length
Any nonzero vector defines a line passing through the origin: . However, and define the exact same geometric line while having different lengths.
To separate pure direction from arbitrary length, we divide by its Euclidean norm to obtain a unit vector :
Note that and are the only two unit vectors spanning the line ; flipping to simply flips the positive and negative ends of the 1D ruler without changing the line itself.
2. Scalar Projection: The 1D Compressed Score
Let be the angle between a data point and the unit axis . From the geometric definition of the dot product:
In right-triangle trigonometry, is literally the adjacent side of the right triangle—the signed distance from the origin to the perpendicular shadow of on the line! In PCA terminology, this scalar value is called the principal component score of observation .
* x_i (Length = ||x_i||)
/|
/ |
/ | Perpendicular drop
/ |
/ |
theta / _ |
Origin (0)======(o)---------> Unit Axis u (||u|| = 1)
|<--- z_i --->|
z_i = ||x_i|| cos(theta) = u^T x_i
3. Vector Reconstruction and the Rank-One Projector
The scalar score is a single number telling us *how far* to walk along the line. To find the actual -dimensional coordinates of that shadow point in the original space, we scale the unit direction vector by :
The Projection Matrix : Whereas the inner product is a scalar, the outer product is a symmetric matrix that projects any vector onto . Projecting a shadow that is already on the line does nothing further: (idempotence).
4. Step-by-Step Worked Numerical Example
Suppose our candidate line points along , and we want to project two centered points and .
- Normalize to a unit vector : Compute . Thus , and we verify .
- Compute 1D scalar scores :
- For : .
- For : .
- Reconstruct 2D shadow points :
- .
- (since already lay on the line, its reconstruction is exact!).
5. Active Recall Check and Key Takeaways
Quick Check: Test Your Understanding
Question: Why does negating a unit eigenvector (replacing with ) negate every scalar score while leaving the 2D reconstructed shadow completely unchanged?
Answer: Replacing with changes the scalar score to . However, when reconstructing the vector shadow, the two minus signs cancel out: . Equivalently, the projection matrix is invariant to sign flips.
- Unit normalization () ensures dot products measure pure geometric distance along the projection line.
- Encoding vs. Decoding: Multiplying by encodes into a 1D score ; multiplying by decodes it back into .
- Canonical References: Review Wikipedia Reference on Vector Projection and MIT OpenCourseWare 18.06 Lecture on Projections onto Subspaces.
Take a Quiz Based on This Article
Test your understanding with AI-generated questions tailored to this content
Adaptive Learning with SynLearn
Explore this article through guided practice that adapts to your answers