In Euclidean geometry, scaling is an affine, linear transformation that can enlarge or diminish an object by certain factors. See also homothety.
A scaling can be represented by a scaling matrix. To scale an object by a vector v = (vx, vy, vz), each point p = (px, py, pz) would need to be multiplied with this scaling matrix:
As shown below, the multiplication will give the expected result:
Often, it is more useful to use homogeneous coordinates, since translation cannot be accomplished with a 3-by-3 matrix. To scale an object by a vector v = (vx, vy, vz), each homogeneous vector p = (px, py, pz, 1) would need to be multiplied with this scaling matrix:
As shown below, the multiplication will give the expected result:
Since the last component of a homogeneous coordinate can be viewed as the denominator of the other three components, a scaling by a common factor s can be accomplished by using this scaling matrix:
For each homogeneous vector p = (px, py, pz, 1) we would have
which would be homogenized to