Scaling (geometry)

From Wikipedia, the free encyclopedia
  (Redirected from Scaling matrix)
Jump to: navigation, search

In Euclidean geometry, uniform scaling (or isotropic scaling,[1]) is a linear transformation that enlarges (increases) or shrinks (diminishes) objects by a scale factor that is the same in all directions. The result of uniform scaling is similar (in the geometric sense) to the original. A scale factor of 1 is normally allowed, so that congruent shapes are also classed as similar. (Some school text books specifically exclude this possibility, just as some exclude squares from being rectangles or circles from being ellipses.)

More general is scaling with a separate scale factor for each axis direction. Non-uniform scaling (anisotropic scaling) is obtained when at least one of the scaling factors is different from the others; a special case is directional scaling or stretching (in one direction). 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 (the angles between lines parallel to the axes are preserved, but not all angles).

When the scale factor is larger than 1, (uniform or non-uniform) scaling is sometimes also called dilation or enlargement. When the scale factor is a positive number smaller than 1, scaling is sometimes also called contraction.

In the most general sense, a scaling includes the case that the directions of scaling are not perpendicular. It includes also the case that one or more scale factors are equal to zero (projection), and the case of one or more negative scale factors (a directional scaling by -1 is equivalent to a reflection).

Scaling is a linear transformation, and a special case of homothetic transformation. In most cases, the homothetic transformations are non-linear transformations.

Contents

[edit] Matrix representation

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:

 S_v = 
\begin{bmatrix}
v_x & 0 & 0  \\
0 & v_y & 0  \\
0 & 0 & v_z  \\
\end{bmatrix}.

As shown below, the multiplication will give the expected result:


S_vp =
\begin{bmatrix}
v_x & 0 & 0  \\
0 & v_y & 0  \\
0 & 0 & v_z  \\
\end{bmatrix}
\begin{bmatrix}
p_x \\ p_y \\ p_z 
\end{bmatrix}
=
\begin{bmatrix}
v_xp_x \\ v_yp_y \\ v_zp_z
\end{bmatrix}.

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 (vx = vy = vz). 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.

[edit] Using homogeneous coordinates

In projective geometry, often used in computer graphics, points are represented using homogeneous coordinates. To scale an object by a vector v = (vx, vy, vz), each homogeneous coordinate vector p = (px, py, pz, 1) would need to be multiplied with this projective transformation matrix:

 S_v = 
\begin{bmatrix}
v_x & 0 & 0 & 0 \\
0 & v_y & 0 & 0 \\
0 & 0 & v_z & 0 \\
0 & 0 & 0 & 1 
\end{bmatrix}.

As shown below, the multiplication will give the expected result:


S_vp =
\begin{bmatrix}
v_x & 0 & 0 & 0 \\
0 & v_y & 0 & 0 \\
0 & 0 & v_z & 0 \\
0 & 0 & 0 & 1 
\end{bmatrix}
\begin{bmatrix}
p_x \\ p_y \\ p_z \\ 1 
\end{bmatrix}
=
\begin{bmatrix}
v_xp_x \\ v_yp_y \\ v_zp_z \\ 1 
\end{bmatrix}.

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 factor s (uniform scaling) can be accomplished by using this scaling matrix:

 S_v = 
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & \frac{1}{s} 
\end{bmatrix}.

For each vector p = (px, py, pz, 1) we would have


S_vp =
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & \frac{1}{s}  
\end{bmatrix}
\begin{bmatrix}
p_x \\ p_y \\ p_z \\ 1 
\end{bmatrix}
=
\begin{bmatrix}
p_x \\ p_y \\ p_z \\ \frac{1}{s} 
\end{bmatrix}

which would be homogenized to


\begin{bmatrix}
sp_x \\ sp_y \\ sp_z \\ 1 
\end{bmatrix}.

[edit] Footnotes

  1. ^ Durand; Cutler. "Transformations" (PowerPoint). Massachusetts Institute of Technology. http://groups.csail.mit.edu/graphics/classes/6.837/F03/lectures/04_transformations.ppt. Retrieved 12 September 2008. 

[edit] See also

[edit] External links

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages