In Euclidean geometry, uniform scaling is a linear transformation that enlarges or shrinks objects by a scale factor that is the same in all directions. The result of uniform scaling is similar to the original. A scale factor of 1 is normally allowed, so that congruent shapes are also classed as similar. Uniform scaling happens, for example, when enlarging or reducing a photograph, or when creating a scale model of a building, car, airplane, etc. More general is scaling with a separate scale factor for each axis direction. Non-uniform scaling is obtained when at least one of the scaling factors is different from the others; a special case is directional scaling or stretching. Non-uniform scaling changes the shape of the object; e.g. a square may change into a rectangle, or into a parallelogram if the sides of the square are not parallel to the scaling axes. It occurs, for example, when a faraway billboard is viewed from an oblique angle, or when the shadow of a flat object falls on a surface that is not parallel to it. When the scale factor is larger than 1, scaling is sometimes also called dilation or enlargement. When the scale factor is a positive numbersmaller than 1, scaling is sometimes also called contraction. In the most general sense, a scaling includes the case in which the directions of scaling are not perpendicular. It also includes the case in which one or more scale factors are equal to zero, and the case of one or more negative scale factors. Scaling is a linear transformation, and a special case of homothetic transformation. In most cases, the homothetic transformations are non-linear transformations.
Matrix representation
A scaling can be represented by a scaling matrix. To scale an object by a vectorv =, each point p = would need to be multiplied with this scaling matrix: As shown below, the multiplication will give the expected result: Such a scaling changes the diameter of an object by a factor between the scale factors, the area by a factor between the smallest and the largest product of two scale factors, and the volume by the product of all three. The scaling is uniform if and only if the scaling factors are equal. If all except one of the scale factors are equal to 1, we have directional scaling. In the case where vx = vy = vz = k, scaling increases the area of any surface by a factor of k2 and the volume of any solid object by a factor of k3.
Scaling in arbitrary dimensions
In -dimensional space, uniform scaling by a factor is accomplished by scalar multiplication with, that is, multiplying each coordinate of each point by. As a special case of linear transformation, it can be achieved also by multiplying each point with a diagonal matrix whose entries on the diagonal are all equal to, namely . Non-uniform scaling is accomplished by multiplication with any symmetric matrix. The eigenvalues of the matrix are the scale factors, and the corresponding eigenvectors are the axes along which each scale factor applies. A special case is a diagonal matrix, with arbitrary numbers along the diagonal: the axes of scaling are then the coordinate axes, and the transformation scales along each axis by the factor. In uniform scaling with a non-zero scale factor, all non-zero vectors retain their direction, or all have the direction reversed, depending on the sign of the scaling factor. In non-uniform scaling only the vectors that belong to an eigenspace will retain their direction. A vector that is the sum of two or more non-zero vectors belonging to different eigenspaces will be tilted towards the eigenspace with largest eigenvalue.
In projective geometry, often used in computer graphics, points are represented using homogeneous coordinates. To scale an object by a vector v =, each homogeneous coordinate vector p = would need to be multiplied with this projective transformation 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 uniform scaling by a common factors can be accomplished by using this scaling matrix: For each vector p = we would have which would be equivalent to
Function dilation and contraction
Given a point, the dilation associates it with the point through the equations for. Therefore, given a function, the equation of the dilated function is
Particular cases
If, the transformation is horizontal; when, it is a dilation, when, it is a contraction. If, the transformation is vertical; when it is a dilation, when, it is a contraction. If or, the transformation is a squeeze mapping.