In
Euclidean geometry, a
translation (geometry) moves every point a constant distance in a specified direction. A translation can be described as a
rigid motion: other rigid motions include rotations and reflections. A translation can also be interpreted as the addition of a constant
vector to every point, or as shifting the
origin of the
coordinate system. A
translation operator is an
operator T_\mathbf{\delta} such that T_\mathbf{\delta} f(\mathbf{v}) = f(\mathbf{v}+\mathbf{\delta}). If
v is a fixed vector, then the translation
Tv will work as
Tv(
p) =
p +
v. If
T is a translation, then the
image of a subset
A under the
function T is the
translation of
A by
T. The translation of
A by
Tv is often written
A +
v. In a
Euclidean space, any translation is an
isometry. The set of all translations forms the translation group
T, which is isomorphic to the space itself, and a
normal subgroup of
Euclidean group E(
n ). The
quotient group of
E(
n ) by
T is isomorphic to the
orthogonal group O(
n ): :
E(
n )
/ T ≅
O(
n ).
Translation Since a translation is an
affine transformation but not a
linear transformation,
homogeneous coordinates are normally used to represent the translation operator by a
matrix and thus to make it linear. Thus we write the 3-dimensional vector
w = (
wx,
wy,
wz) using 4 homogeneous coordinates as
w = (
wx,
wy,
wz, 1). To translate an object by a
vector v, each homogeneous vector
p (written in homogeneous coordinates) would need to be multiplied by this
translation matrix: : T_{\mathbf{v}} = \begin{bmatrix} 1 & 0 & 0 & v_x \\ 0 & 1 & 0 & v_y \\ 0 & 0 & 1 & v_z \\ 0 & 0 & 0 & 1 \end{bmatrix} As shown below, the multiplication will give the expected result: : T_{\mathbf{v}} \mathbf{p} = \begin{bmatrix} 1 & 0 & 0 & v_x \\ 0 & 1 & 0 & v_y\\ 0 & 0 & 1 & v_z\\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} p_x \\ p_y \\ p_z \\ 1 \end{bmatrix} = \begin{bmatrix} p_x + v_x \\ p_y + v_y \\ p_z + v_z \\ 1 \end{bmatrix} = \mathbf{p} + \mathbf{v} The inverse of a translation matrix can be obtained by reversing the direction of the vector: : T^{-1}_{\mathbf{v}} = T_{-\mathbf{v}} . \! Similarly, the product of translation matrices is given by adding the vectors: : T_{\mathbf{u}}T_{\mathbf{v}} = T_{\mathbf{u}+\mathbf{v}} . \! Because addition of vectors is
commutative, multiplication of translation matrices is therefore also commutative (unlike multiplication of arbitrary matrices).
Rotation In
linear algebra, a
rotation matrix is a
matrix that is used to perform a
rotation in
Euclidean space. :R = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix} rotates points in the
xy-
Cartesian plane counterclockwise through an angle
θ about the origin of the
Cartesian coordinate system. To perform the rotation using a rotation matrix
R, the position of each point must be represented by a
column vector v, containing the coordinates of the point. A rotated vector is obtained by using the
matrix multiplication Rv. Since matrix multiplication has no effect on the zero vector (i.e., on the coordinates of the origin), rotation matrices can only be used to describe rotations about the origin of the coordinate system. Rotation matrices provide a simple algebraic description of such rotations, and are used extensively for computations in
geometry,
physics, and
computer graphics. In 2-dimensional space, a rotation can be simply described by an
angle θ of rotation, but it can be also represented by the 4 entries of a rotation matrix with 2 rows and 2 columns. In 3-dimensional space, every rotation can be interpreted as a rotation by a given angle about a single fixed axis of rotation (see
Euler's rotation theorem), and hence it can be simply described by
an angle and a vector with 3 entries. However, it can also be represented by the 9 entries of a rotation matrix with 3 rows and 3 columns. The notion of rotation is not commonly used in dimensions higher than 3; there is a notion of a
rotational displacement, which can be represented by a matrix, but no associated single axis or angle. Rotation matrices are
square matrices, with
real entries. More specifically they can be characterized as
orthogonal matrices with
determinant 1: :R^{T} = R^{-1}, \det R = 1\,. The
set of all such matrices of size
n forms a
group, known as the
special orthogonal group .
In two dimensions In two dimensions every rotation matrix has the following form: : R(\theta) = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix}. This rotates
column vectors by means of the following
matrix multiplication: : \begin{bmatrix} x' \\ y' \\ \end{bmatrix} = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix}\begin{bmatrix} x \\ y \\ \end{bmatrix}. So the coordinates (x',y') of the point (x,y) after rotation are: :x' = x \cos \theta - y \sin \theta\,, :y' = x \sin \theta + y \cos \theta\,. The direction of vector rotation is counterclockwise if θ is positive (e.g. 90°), and clockwise if θ is negative (e.g. -90°). : R(-\theta) = \begin{bmatrix} \cos \theta & \sin \theta \\ -\sin \theta & \cos \theta \\ \end{bmatrix}\,.
Non-standard orientation of the coordinate system If a standard
right-handed Cartesian coordinate system is used, with the
x axis to the right and the
y axis up, the rotation R(
θ) is counterclockwise. If a left-handed Cartesian coordinate system is used, with
x directed to the right but
y directed down, R(
θ) is clockwise. Such non-standard orientations are rarely used in mathematics but are common in 2D computer graphics, which often have the origin in the top left corner and the
y-axis down the screen or page. See
below for other alternative conventions which may change the sense of the rotation produced by a
rotation matrix.
Common rotations Particularly useful are the matrices for 90° and 180° rotations: : R(90^\circ) = \begin{bmatrix} 0 & -1 \\[3pt] 1 & 0 \\ \end{bmatrix} (90° counterclockwise rotation) :R(180^\circ) = \begin{bmatrix} -1 & 0 \\[3pt] 0 & -1 \\ \end{bmatrix} (180° rotation in either direction – a half-turn) :R(270^\circ) = \begin{bmatrix} 0 & 1 \\[3pt] -1 & 0 \\ \end{bmatrix} (270° counterclockwise rotation, the same as a 90° clockwise rotation)
Scaling In
Euclidean geometry,
uniform scaling (
isotropic scaling,
homogeneous dilation,
homothety) 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,
inhomogeneous dilation) 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). 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, the scaling is also called an
enlargement or
dilation by a factor k, increasing the area by a factor of k2 and the volume by a factor of k3. Scaling in the most general sense is any
affine transformation with a
diagonalizable matrix. It includes the case that the three 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. The latter corresponds to a combination of scaling proper and a kind of reflection: along lines in a particular direction we take the reflection in the point of intersection with a plane that need not be perpendicular; therefore it is more general than ordinary reflection in the plane.
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}. ==Techniques==