A point cloud can lie on a vertical line far from the coordinate origin. Its dominant direction of variation is vertical, even though its absolute x coordinates are much larger than its y coordinates.
Principal component analysis separates the location of the cloud from its centered spread. Without that centering, a related origin-constrained approximation can favor the direction toward the cloud instead of the direction along it.
The original two-dimensional construction below derives both objectives. It is not a measured point cloud, object-orientation estimate, uncertainty ellipse, or robot alignment result.
Declare a translated set of points
Use four points with coordinates in millimeters: (10, −3), (10, −1), (10, 1), and (10, 3). Give each equal weight.
Their arithmetic mean is mu = (10, 0). Subtracting mu produces centered vectors z1 = (0, −3), z2 = (0, −1), z3 = (0, 1), and z4 = (0, 3).
Every centered vector lies along the y direction. Translating the original points farther along x would change their mean while leaving these centered vectors unchanged.
Scikit-learn's PCA reference states that its input is centered and that principal axes identify maximum-variance directions. NumPy's eigh reference describes the associated symmetric-matrix eigenpairs. The following projection and reconstruction calculations are independent algebra, rather than outputs from those APIs.
Define a one-dimensional representation
Choose any unit direction u = (cos(theta), sin(theta)). Represent each centered point by one scalar score a_i = u dot z_i.
Reconstruct the original point as p_hat_i = mu + a_i u. The reconstructed points lie on the line through mu in direction u.
The mean is retained separately from the one-dimensional score. Omitting mu during reconstruction would produce points on a line through the origin, which is a different model.
For the four constructed points, their scores are −3 sin(theta), −sin(theta), sin(theta), and 3 sin(theta). Their mean score is zero because the centered vectors sum to zero.
Maximize the retained variation
The sum of squared scores is (9 + 1 + 1 + 9) sin²(theta) = 20 sin²(theta).
Using the sample-variance denominator n − 1 = 3 gives projected sample variance (20/3) sin²(theta), in square millimeters. It is largest when sin²(theta) = 1, so u can be (0, 1) or (0, −1).
These opposite vectors describe the same fitted line. Their scores have opposite signs, but multiplying each score by its corresponding direction produces the same reconstructed points.
Along the x direction, every centered score is zero, so projected variance is zero. Large absolute x coordinates have not generated centered x variation.
The centered scatter matrix is [[0, 0], [0, 20]]. Its normalized eigenvectors are the coordinate directions, with eigenvalues zero and twenty. Dividing by three gives the sample covariance eigenvalues zero and 20/3.
This is a rank-one dataset, so no covariance inverse is required for the projection calculation. The task is to retain variation, not to normalize residuals by an uncertainty model.
Minimize reconstruction error through the mean
Because u has unit length, the squared distance from a centered point z_i to its projection a_i u is ||z_i||² − a_i². Summing gives total squared reconstruction error:
20 − 20 sin²(theta) = 20 cos²(theta).
Maximizing retained score variation therefore minimizes the residual for this declared orthogonal projection model. The vertical direction achieves zero error and exactly reconstructs all four original points.
The horizontal line through mu instead reconstructs every point as (10, 0). Its squared errors are nine, one, one, and nine, totaling twenty square millimeters.
This equivalence follows from the unit-direction projection and a line through the mean. Changing the distance metric, weighting, or reconstruction model changes the objective that must be optimized.
Remove centering and the objective changes
Suppose the same raw points are approximated by a line constrained to pass through the coordinate origin. Their uncentered second-moment sum is [[400, 0], [0, 20]].
The x term is four times 10² = 400. The cross term is 10 times (−3 − 1 + 1 + 3) = 0. The y term remains twenty.
The retained squared projection sum for a unit direction is now 400 cos²(theta) + 20 sin²(theta). It is maximized horizontally, with u = (1, 0) or its negative.
That origin-constrained horizontal fit has squared error twenty. An origin-constrained vertical line would lose all four x coordinates and have squared error four hundred.
The uncentered calculation is internally consistent for its own constraint. It simply solves a different problem from finding the best line through the cloud's mean. Calling both outputs the cloud's dominant centered direction would hide that changed objective.
Scaling is another modeling choice
All coordinates here use the same length unit and the ordinary Euclidean metric. Changing both axes from millimeters to meters scales all squared variations equally and leaves the fitted direction unchanged.
Rescaling only one feature changes the metric of the numerical problem. Standardizing features before PCA can therefore select a different direction, especially when features have different units or purposes. Scikit-learn explicitly distinguishes centering from feature scaling.
Repeated largest eigenvalues can also leave a principal direction nonunique. A reported vector then needs its ambiguity understood rather than interpreted as a uniquely identified physical axis.
For robot point-cloud records, preserve the selected points, weighting, coordinate units, mean, scaling, and reconstruction objective. A direction derived from centered variation can then be distinguished from a direction dominated by the cloud's offset from the origin.
Sources checked October 24, 2026
Scikit-learn 1.7.2, PCA:
https://scikit-learn.org/1.7/modules/generated/sklearn.decomposition.PCA.html
NumPy 2.3, numpy.linalg.eigh:
https://numpy.org/doc/2.3/reference/generated/numpy.linalg.eigh.html
All points and objectives are original hypothetical calculations. No PCA or eigenvalue library was executed.
Illustration note: A generic robot vision scene is a concept illustration. It does not show the constructed points or a measured object direction.