Affine Transformation Matrix Calculator

Build affine matrices from real world transform controls. Combine rotation, scale, shear, and translation safely. See matrices, inverses, and point mappings in one place.

Calculator

Build from transform parameters, or enter a matrix directly. The input grid adapts to screen size.

Tip
Use pivots to rotate or scale around any point.
Custom tokens: REFLECT,SCALE,SHEAR,ROTATE,TRANSLATE
tx ty
sx sy
pivot x pivot y
angle
pivot x pivot y
shx shy
pivot x pivot y
pivot x pivot y
Pivot shifts the reflection origin.
Accepted separators: comma, space, or semicolon. Invalid lines are ignored.
Reset

Formula used

A 2D affine transform is represented with homogeneous coordinates:

[x′]=[ a b tx ] [x]
[y′] [ c d ty ] [y]
[ 1 ] [ 0 0 1 ] [1]
  • Composition: applying transforms in sequence multiplies matrices on the left: M = On…O2O1.
  • Pivots: rotate/scale around (px, py) using T(p)·R·T(−p) or T(p)·S·T(−p).
  • Determinant: det(L) = a·d − b·c measures area scaling and orientation.
  • Inverse: if det(L) ≠ 0, then M−1 uses L−1 and t′ = −L−1t.

How to use this calculator

  1. Choose Parameters to build a matrix from translation, scale, shear, rotation, and reflection.
  2. Pick an operation order. Changing the order changes the final mapping.
  3. Set pivots if you need rotation or scaling around a specific point.
  4. Paste one or more points (x,y) to see mapped coordinates instantly.
  5. Press Compute matrix. The matrix, determinant, inverse, and point table appear above.
  6. Use Download CSV or Download PDF to export your results.

Example data table

Example setup: scale (1.2, 0.8) about (1,1), rotate 30° about (1,1), then translate (3, −2).

Example matrix
1.03923048 -0.6 4.87846097
0.4 0.69282032 -0.27846097
0 0 1
Linear det: 0.96
Example point mapping
Input (x, y) Output (x′, y′)
0, 0 4.87846097, -0.27846097
2, 0 6.95692194, 0.52153903
0, 2 3.67846097, 1.10717968
1, 1 5.31769145, 0.81435935

Affine matrices and degrees of freedom

In 2D, an affine transform is fully described by six parameters: a, b, c, d, tx, ty. The linear block [[a,b],[c,d]] controls rotation, scaling, and shear, while (tx,ty) shifts the origin. Because it is linear-plus-translation, straight lines remain straight and parallel lines stay parallel. Circles typically become ellipses unless the linear part is a pure rotation or uniform scale.

Operation order and composition effects

When you combine operations, the final matrix depends on the order of multiplication. For example, scaling then translating moves points by the scaled translation, while translating then scaling leaves translation unscaled. Rotating after translating swings the translation vector around the origin. This calculator applies each operation as a 3×3 matrix and composes them via left-multiplication, matching graphics and geometry conventions. Custom sequences help you replicate pipeline steps from rendering, robotics frames, or image registration.

Determinant as an area and orientation metric

The determinant det(L)=a·d−b·c summarizes how the linear part stretches the plane. |det(L)| is the area scale factor: det=2 doubles areas, det=0.5 halves them, and det=0 collapses the plane to a line, making the transform non-invertible. A negative determinant indicates an orientation flip, often caused by reflections. Values very close to zero imply strong compression and unstable inverses; the tool flags non-invertibility at a threshold.

Pivots and local coordinate control

Pivots let you rotate or scale about an arbitrary point (px,py) rather than the global origin. Internally, the calculator uses T(px,py)·R·T(−px,−py) and T(px,py)·S·T(−px,−py) to keep the chosen point fixed. For rotations you can enter degrees or radians; internally radians are used for trigonometric evaluation. Shear factors shx and shy approximate tan(θ) for small angles, enabling slanted axes modeling. This mirrors workflows in CAD, animation rigs, and map projections.

Point mapping and export-ready outputs

Beyond the matrix, practical work needs mapped coordinates. Enter any list of points and the tool returns (x,y)→(x′,y′) pairs using homogeneous evaluation. The inverse matrix, when available, is computed from L^{-1} and the translated term −L^{-1}t, letting you back-transform measurements. The CSV export is suited for spreadsheets and checks, while the PDF captures matrices, determinant, inverse status, and mapping tables for documentation and audit trails.

FAQs

1) What does an affine transformation preserve?

It preserves collinearity and parallelism: straight lines map to straight lines and parallel lines remain parallel. Ratios along the same line are preserved, but lengths and angles generally change unless the linear part is a pure rotation.

2) Why does changing the operation order change results?

Matrix multiplication is not commutative. Scaling then translating scales the translation effect, while translating then scaling does not. The same applies to rotation, shear, and reflection, so the sequence must match your intended workflow.

3) What does the determinant tell me?

|det(L)| is the area scale factor of the linear part. det(L)=1 preserves area, det(L)=2 doubles it, and det(L)<0 indicates an orientation flip. If det(L)=0, the transform collapses dimensions and cannot be inverted.

4) Why is the inverse sometimes unavailable?

If the linear determinant is zero (or extremely close to zero), the mapping is not one-to-one. Points can collapse onto a line or a point, so there is no unique way to reverse the transform.

5) How do pivots work for rotation and scaling?

A pivot keeps a chosen point fixed. The tool applies translate-to-pivot, then rotate/scale, then translate back: T(p)·R·T(−p) or T(p)·S·T(−p). This matches common CAD and graphics behavior.

6) How should I interpret shear values shx and shy?

shx skews x as x′=x+shx·y, and shy skews y as y′=y+shy·x (before translation). For small angles, shear is approximately tan(θ). Large values can strongly distort shapes and reduce invertibility.

Related Calculators

Row Reduction RREF CalculatorDiagonalization Checker CalculatorLU Decomposition Steps CalculatorQR Decomposition Steps Calculatormatrix calculator with variablesGauss-Jordan inverse calculatorPolynomial linear independence calculatorLinear independence of matrix calculatorComplex matrix inverse calculatorQR decomposition least squares

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.