2D Transformation Matrix Calculator

Apply a 2D affine transformation matrix to a point. This educational calculator shows the formula, result, and step-by-step interpretation.

Computer ScienceLinear AlgebraGraphics Math

Calculator

What this calculator teaches

2D transformation matrices power graphics, animation, UI geometry, robotics, and coordinate transforms.

Use the result as a learning aid. For classwork, still show the formula and intermediate reasoning so the final answer is not just a black-box number.

Understanding 2D Affine Transformations

A 2D affine transformation maps a point (x,y) to a new point by combining a 2×2 linear transformation with a translation. In matrix form, the calculator evaluates x′=ax+by+tₓ and y′=cx+dy+tᵧ. The coefficients a,b,c,d can encode rotation, scaling, reflection, shear, or a combination of those effects, while tₓ and tᵧ shift every point by the same amount.

The identity linear part is [[1,0],[0,1]]. With that choice, only the translation column changes the point. A diagonal matrix such as [[2,0],[0,3]] stretches x-coordinates by 2 and y-coordinates by 3. A 90° counterclockwise rotation can be represented by [[0,-1],[1,0]]. Because affine transformations preserve straight lines and parallelism, they are widely used in graphics, mapping, CAD, animation, and coordinate conversion.

OperationTypical matrix pattern
Translation[[1,0,tₓ],[0,1,tᵧ]]
Scale[[sₓ,0,0],[0,sᵧ,0]]
90° CCW rotation[[0,-1,0],[1,0,0]]

When checking a result, separate the linear part from the translation. First compute the two dot products using x and y, then add the translation terms. Also remember that transformation order matters: rotate-then-translate generally differs from translate-then-rotate.

How to sanity-check a 2D transform. Test the origin and one simple basis direction. The origin (0,0) should map directly to the translation vector (tₓ,tᵧ). The point (1,0) reveals the first column of the linear part plus the same translation, while (0,1) reveals the second column. These quick tests make it easier to detect a swapped coefficient or sign error before transforming a larger set of points.

For a pure rotation, distances from the origin should stay unchanged when translation is zero. For a uniform scale s, distances should be multiplied by |s|. If a shape is unexpectedly mirrored, check the determinant of the 2×2 linear part: a negative determinant reverses orientation, while a positive determinant preserves orientation.

Formula & Symbols

ConceptFormula or rule
Affine transformx′ = ax + by + tx, y′ = cx + dy + ty

Worked example

Example: A matrix with tx=3 and ty=2 translates point (4,5) to (7,7).
Example 2: Identity with translation (3,2) maps (4,5) to (7,7).
Example 3: The scale matrix [[2,0,0],[0,3,0]] maps (2,-1) to (4,-3).
Example 4: A 90° counterclockwise rotation [[0,-1,0],[1,0,0]] maps (3,1) to (-1,3).
Example 5: The shear matrix [[1,2,0],[0,1,0]] maps (2,3) to (8,3).

Common mistakes

⚠️
Using the wrong input format

Keep lists comma separated, matrices as rows separated by semicolons, and modular inputs as integers.

⚠️
Ignoring assumptions

Some methods require positive probabilities, valid moduli, independent trials, or small educational input sizes.

⚠️
Mixing row and column roles

The first matrix row produces x′ and the second row produces y′. Swapping coefficients changes the transformation.

⚠️
Treating translations as ordinary 2×2 multiplication

The final column contains added offsets. Translation is affine; it cannot be represented by a 2×2 linear matrix alone.

FAQ

Can I use decimals?
Most numerical calculators allow decimals, but modular arithmetic and coding-theory tools usually require integers or binary strings.
Is this for homework checking?
Yes. The page is designed to show both the answer and the reasoning pattern.
Why does the result sometimes say approximate?
Some probability, floating-point, and numerical methods naturally produce approximations.
Does an affine transform preserve distances?
Not always. Pure rotations and reflections preserve distance, but scaling and shear generally do not.
How do I represent no transformation?
Use [[1,0,0],[0,1,0]], which leaves every point unchanged.
Why does transform order matter?
Matrix multiplication is not generally commutative. Applying A then B usually gives a different result from B then A.
Can this calculator perform perspective projection?
No. Perspective is a projective transformation and requires homogeneous-coordinate division, not an ordinary 2D affine matrix.

Related calculators

These links will work after the calculators are registered in the final Math layout update.

Formula Explorer connections

Interpretation: This relationship connects dimensions, coordinates, angles or trigonometric ratios to a geometric measurement. Assumption: Use a consistent angle mode and length unit, identify the intended shape or coordinate system, and verify that the supplied dimensions form valid geometry.

3D Transformation Matrix Calculator →Angle Calculator →Arc Length & Sector Area Calculator →Math Formula Explorer →