Linear Transformation Calculator
Apply rotation, scaling, or reflection transformations to 2D vectors and see the resulting coordinates. Ideal for linear algebra students and graphics programmers exploring how matrices act on vectors.
About this calculator
A linear transformation maps a vector to a new vector while preserving addition and scalar multiplication. For a rotation by angle θ, the output x-component is x′ = cos(θ)·vx − sin(θ)·vy and the y-component is y′ = cos(θ)·vy + sin(θ)·vx (using standard rotation matrix convention). For uniform scaling, x′ = scaleX · vx and y′ = scaleY · vy. For reflection across the y-axis, x′ = −vx and y′ = vy. Each transformation corresponds to multiplying the input vector by a 2×2 transformation matrix. Understanding these operations is foundational for computer graphics, robotics, and differential geometry, where coordinate systems must be changed or objects manipulated in space.
How to use
Example: rotate the vector (3, 1) by 45°. Select 'rotation' and enter angle = 45, vectorX = 3, vectorY = 1. Compute cos(45°) ≈ 0.7071 and sin(45°) ≈ 0.7071. Output x′ = cos(45°)·3 − sin(45°)·1 = 0.7071·3 − 0.7071·1 = 2.1213 − 0.7071 = 1.4142. Output y′ = cos(45°)·1 + sin(45°)·3 = 0.7071 + 2.1213 = 2.8284. The transformed vector is approximately (1.414, 2.828), which has the same magnitude as the original (√10 ≈ 3.162), confirming rotation preserves length.
Frequently asked questions
What is the difference between rotation and reflection in a linear transformation?
Rotation turns a vector around the origin by a specified angle, preserving both the vector's length and the orientation of the coordinate system. Reflection flips a vector across an axis (e.g., the y-axis negates the x-component), which also preserves length but reverses orientation — a reflected shape becomes its mirror image. Both are orthogonal transformations, meaning the transformation matrix has determinant ±1. Rotation has determinant +1; reflection has determinant −1.
How does scaling affect a vector in a linear transformation?
Scaling multiplies each component of the vector by a corresponding scale factor: x′ = scaleX · vx and y′ = scaleY · vy. Uniform scaling (scaleX = scaleY) enlarges or shrinks the vector while keeping its direction unchanged. Non-uniform scaling stretches or compresses the vector differently along each axis, changing its direction unless it is aligned with an axis. The magnitude of the output vector equals √((scaleX·vx)² + (scaleY·vy)²).
Why do linear transformations always pass through the origin?
By definition, a linear transformation T satisfies T(0) = 0, meaning the zero vector maps to itself. This is a direct consequence of the linearity properties: T(αu + βv) = αT(u) + βT(v). Geometrically, this means linear transformations can rotate, scale, or shear space, but they can never translate the origin to a different point — that would require an affine transformation. If you need translation, you must use homogeneous coordinates and a 3×3 matrix for 2D operations.