Linear Transformation Calculator

Matrix · Vector · Visualisation

Explore linear transformations in 2D and 3D. Enter a 2×2 or 3×3 matrix and a vector, compute the image A·v, determinant and trace, and see an interactive visualisation of how the matrix transforms the plane in 2D.

matrix–vector product determinant & trace 2D geometry visualisation linear algebra intuition

Linear transformation inputs (matrix & vector)

2D mode comes with an interactive plot; 3D mode focuses on numeric output.

2×2 matrix A (2D)

Rows correspond to outputs of basis vectors e₁, e₂.

Vector v in ℝ²

The linear transformation sends v to A·v.

In the plot below you will see v and A·v, plus the image of the unit square.

2D visualisation of the linear transformation

Works in 2D mode only

The canvas shows the original axes, the unit square, the transformed unit square A(Q), and the vector v together with its image A·v.

Original axes & unit square
Transformed basis vectors A e₁, A e₂
Vector v
Transformed vector A·v

Try different matrices (shears, scalings, rotations) and vectors to see how linear transformations stretch, rotate and reflect the plane while keeping grid lines straight.

What is a linear transformation?

Informally, a linear transformation is a map that sends vectors to vectors while preserving the structure of vector addition and scalar multiplication. A function \(T: \mathbb{R}^n \to \mathbb{R}^m\) is linear if for all vectors \(\mathbf{u}, \mathbf{v}\) and scalars \(c\),

\[ T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v}),\quad T(c\,\mathbf{u}) = c\,T(\mathbf{u}). \]

In coordinates, any linear transformation can be represented as multiplication by a matrix. When you enter a matrix \(A\) and a vector \(\mathbf{v}\) in this calculator, the result \(A\mathbf{v}\) is exactly the image \(T(\mathbf{v})\).

Matrix representation in 2D

A 2D linear transformation \(T: \mathbb{R}^2 \to \mathbb{R}^2\) is represented by a 2×2 matrix \[ A = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}. \] For a vector \(\mathbf{v} = (x, y)\), \[ A\mathbf{v} = \begin{bmatrix} a_{11}x + a_{12}y \\ a_{21}x + a_{22}y \end{bmatrix}. \]

Geometrically, the columns of \(A\) are the images of the basis vectors \(e_1 = (1, 0)\) and \(e_2 = (0, 1)\).

Determinant, trace and geometric meaning

For a 2×2 or 3×3 matrix, the determinant and trace give quick insight into the geometry of the linear transformation:

  • Determinant \(\det(A)\): area (2D) or volume (3D) scaling factor. If \(\det(A) = 0\), the transformation collapses space onto a lower-dimensional subspace (no inverse).
  • Sign of determinant: positive means orientation is preserved; negative means the transformation includes a reflection.
  • Trace \(\mathrm{tr}(A)\): sum of diagonal entries. In many contexts, it equals the sum of eigenvalues and relates to the average scaling effect along principal directions.

Typical types of linear transformations

  • Pure scaling: multiplies every vector by the same factor (e.g. diagonal matrices with equal diagonal entries).
  • Rotation: preserves lengths and angles, with determinant \(+1\).
  • Reflection: flips orientation (determinant negative) while preserving some distances.
  • Shear: slides points along a direction while keeping one axis fixed, changing area but keeping some lines parallel.
  • Projection: collapses vectors onto a line or plane, always with determinant 0.

Using this calculator for learning and practice

This tool is useful for students of linear algebra, data scientists and engineers who need intuition about matrices. You can:

  • Test examples from textbooks by entering the matrix and vectors directly.
  • Explore how the determinant changes when you adjust individual matrix entries.
  • Visualise how shears, rotations and reflections act on the unit square.
  • Relate geometric effects to concepts like eigenvalues, eigenvectors and rank.

Related algebra & 3D math tools