Linear algebra · Geometry · Interactive matrix tool

2D Matrix Transformation Simulator

Transform two-dimensional points and shapes using matrices. Experiment with rotation, scaling, reflection, and shear, or enter your own 2 × 2 matrix. See the geometric result, transformed coordinates, determinant, and step-by-step calculations.

Interactive 2D transformation

Edit the matrix or select a transformation preset.

2 × 2 matrix

Transformation matrix A

Enter the four matrix coefficients. The simulator uses column vectors.

A = [ a   b ]
    [ c   d ]

Translation vector

Translation is added separately after the 2 × 2 linear transformation.

Ready. Change the matrix or select a preset.

Transformation visualization

■ Original   ■ Transformed
The coordinate plane shows the original shape and the result of applying the matrix and translation vector.

Transformation results

Inspect the transformed coordinates and important matrix properties.

Determinant 1.0000
Area scale factor 1.0000
Orientation Preserved
Invertibility Yes

Transformed matrix and affine representation

The 2 × 2 matrix handles the linear part. With translation, the complete operation can be represented using homogeneous coordinates.

Linear matrix A
0.7071-0.7071 0.70710.7071
Homogeneous matrix H
10 01

The full 3 × 3 matrix is displayed using the selected translation.

Point coordinates

Every vertex is transformed independently using x′ = ax + by + tₓ and y′ = cx + dy + tᵧ.

Point Original x Original y New x New y
P10000

Calculation steps

Apply a transformation to display the calculation details.

What are 2D matrix transformations?

A two-dimensional matrix transformation is a mathematical operation that changes the coordinates of points in a plane. It is widely used in linear algebra, computer graphics, image processing, geometry, robotics, and scientific computing.

A 2 × 2 matrix can represent several important transformations. When it is multiplied by a two-dimensional column vector, it produces a new vector. Applying the same matrix to every vertex of a shape transforms the entire shape.

The general 2 × 2 transformation matrix

A = [ a   b ]
    [ c   d ]

[ x′ ] = [ a   b ] [ x ]
[ y′ ]    [ c   d ] [ y ]

The transformed coordinates are calculated as:

x′ = ax + by
y′ = cx + dy

Rotation transformation

A counterclockwise rotation through an angle θ around the origin uses the following matrix:

R(θ) = [ cos θ   −sin θ ]
      [ sin θ    cos θ ]

Rotation preserves distances, angles, and area. Its determinant is always 1. For example, a rotation of 90 degrees maps (1, 0) to (0, 1).

Scaling transformation

Scaling changes the size of a shape along the horizontal and vertical directions. The scaling matrix is:

S = [ sₓ   0 ]
    [ 0   sᵧ ]

When both scale factors are greater than 1, the shape expands. When both are between 0 and 1, it shrinks. A negative scale factor also introduces a reflection in the corresponding direction.

Reflection transformation

Reflection flips points across a line passing through the origin. Some common reflection matrices are:

Across x-axis: [ 1   0 ]
            [ 0   −1 ]

Across y-axis: [ −1   0 ]
            [ 0    1 ]

Across y = x: [ 0   1 ]
           [ 1   0 ]

Shear transformation

A shear changes the shape of an object by shifting one coordinate in proportion to the other coordinate.

Horizontal shear: [ 1   k ]
            [ 0   1 ]

Vertical shear: [ 1   0 ]
            [ k   1 ]

A shear can turn a square into a parallelogram while preserving its area when the shear matrix has determinant 1.

Translation and homogeneous coordinates

Translation moves every point by the same horizontal and vertical amounts. It is not represented by a 2 × 2 matrix alone because a linear transformation must leave the origin fixed.

By using homogeneous coordinates, translation can be incorporated into a 3 × 3 matrix:

H = [ a   b   tₓ ]
    [ c   d   tᵧ ]
    [ 0   0   1 ]

This simulator uses the equivalent two-step calculation: first apply the 2 × 2 linear transformation, then add the translation vector.

The determinant and geometric meaning

The determinant of a 2 × 2 matrix is:

det(A) = ad − bc

The absolute value of the determinant represents the area scaling factor. A negative determinant reverses orientation. A zero determinant means the transformation collapses the plane into a lower-dimensional result and cannot be inverted.

Combining transformations

Multiple linear transformations can be combined through matrix multiplication. If B is applied first and A second, the combined transformation is AB:

x′ = A(Bx) = (AB)x

The order matters because matrix multiplication is generally not commutative: AB is usually different from BA.

Applications of 2D matrix transformations

Frequently asked questions

What is a 2D matrix transformation?

A 2D matrix transformation maps points in a two-dimensional coordinate plane to new positions. A 2 × 2 matrix represents linear transformations such as rotation, scaling, reflection, and shear. The transformation is applied by multiplying the matrix by a column vector representing a point.

How do you transform a point using a 2 × 2 matrix?

For a matrix A = [[a, b], [c, d]] and a point (x, y), the transformed point is x′ = ax + by and y′ = cx + dy. In matrix notation, this is [x′, y′]ᵀ = A[x, y]ᵀ.

What is a rotation matrix in 2D?

A counterclockwise rotation through an angle θ about the origin uses the matrix [[cos θ, −sin θ], [sin θ, cos θ]]. It rotates every point by the same angle while preserving distances and angles.

Can a 2 × 2 matrix represent translation?

No. A 2 × 2 matrix alone represents a linear transformation and must map the origin to itself. Translation requires an additional vector, or a 3 × 3 homogeneous-coordinate matrix.

What does the determinant tell us about a transformation?

The absolute value of the determinant gives the area scaling factor. A negative determinant indicates an orientation reversal. A zero determinant means the transformation collapses the plane into a line or a point and is not invertible.

What is a shear transformation?

A shear transformation slants a shape by shifting one coordinate in proportion to the other. Horizontal shear uses [[1, k], [0, 1]], while vertical shear uses [[1, 0], [k, 1]].

Can multiple matrix transformations be combined?

Yes. Multiple linear transformations can be combined by multiplying their matrices. Matrix multiplication is generally not commutative, so changing the order of transformations can produce a different result.

What happens when the determinant is zero?

A zero determinant means the transformation is singular. At least one dimension is collapsed, so a two-dimensional shape may become a line or a point. The original shape cannot be uniquely recovered using an inverse matrix.

Related matrix calculators and simulators

Explore more interactive tools for matrix operations and transformations.