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.
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.
| Operation | Typical 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
| Concept | Formula or rule |
|---|---|
| Affine transform | x′ = ax + by + tx, y′ = cx + dy + ty |
Worked example
Common mistakes
Keep lists comma separated, matrices as rows separated by semicolons, and modular inputs as integers.
Some methods require positive probabilities, valid moduli, independent trials, or small educational input sizes.
The first matrix row produces x′ and the second row produces y′. Swapping coefficients changes the transformation.
The final column contains added offsets. Translation is affine; it cannot be represented by a 2×2 linear matrix alone.
FAQ
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.