Reflection Matrix Generator Calculator

Generate reflection matrices quickly for common geometric lines. Choose axis, angle, slope, or points easily. Export results, verify steps, and reuse in lessons today.

Calculator

Select 2D or 3D, choose a reflection rule, then generate the matrix.

Pick a dimension.
θ is the line angle from positive x-axis.
Uses direction vector (1, m).
Creates a plane through the origin with that normal.
How to use Formula used

Example data table

These examples show typical reflections and the matrix format produced.

Scenario Input rule Matrix type Key effect
2D across x-axis (x, y) → (x, −y) 2×2 Flips vertical component
2D across y = x (x, y) → (y, x) 2×2 Swaps coordinates
2D across y = 2x + 1 General line 3×3 Adds translation + reflection
3D across xy-plane (x, y, z) → (x, y, −z) 4×4 Flips depth component

Formula used

2D: line through origin

If the reflection line has unit direction vector u = (uₓ, uᵧ), the matrix is: R = 2uuᵀ − I.

For an angle θ from the x-axis, u = (cosθ, sinθ) and R = [[cos2θ, sin2θ], [sin2θ, −cos2θ]].

2D: general line Ax + By + C = 0

A point reflects as: p′ = p − 2(Ax + By + C)/(A² + B²) · (A, B). The tool expands this into a 3×3 homogeneous matrix.

3D: plane Ax + By + Cz + D = 0

A point reflects as: p′ = p − 2(Ax + By + Cz + D)/(A² + B² + C²) · (A, B, C). The tool outputs a 4×4 homogeneous matrix.

How to use this calculator

  1. Select 2D or 3D in the dimension field.
  2. Pick a reflection option (axis, angled line, slope, or a general line/plane).
  3. Fill any required inputs, then press Generate.
  4. Your matrix appears below the header and above the form.
  5. Use Download CSV or Download PDF for exporting.

Why reflection matrices matter in linear algebra

Reflections are distance‑preserving transformations used in geometry and graphics. A reflection matrix is orthogonal, so its transpose equals its inverse, and it flips orientation with determinant −1. This calculator produces matrices you can plug into coordinate pipelines, test on sample points, and store for documentation. Because reflections are linear (or affine in homogeneous form), they compose with rotations, scalings, and translations via matrix multiplication. In teaching, it also helps students connect geometric intuition to algebraic structure, symmetry constraints, and debugging habits.

Standard 2D reflections and quick matrices

In 2D, standard reflections are easy to recognize. Across the x‑axis, y changes sign; across the y‑axis, x changes sign. Across the line y=x, coordinates swap; across y=−x, they swap and negate. When you choose a preset, the tool outputs the exact matrix and shows the reflected point so you can confirm the symmetry visually and numerically.

Reflection across an arbitrary line

For a line not aligned with axes, the matrix depends on the line’s unit direction and its normal. For a line through the origin with unit direction u, the reflection is R = 2uuᵀ − I. For a shifted line, the calculator derives a unit normal n and an offset, then builds an affine transform that keeps points on the line fixed. This supports mirroring sketches and aligning measured profiles.

3D reflections across planes and origin

In 3D, reflecting across a plane uses the plane’s unit normal n. For planes through the origin, the reflection is R = I − 2nnᵀ. For planes with equation Ax+By+Cz+D=0, the calculator also applies a translation term so the plane stays invariant. The 4×4 homogeneous output fits common 3D pipelines, and the origin option performs central inversion as a symmetry case.

Validation checks for reliable results

Simple checks keep results reliable. A valid reflection matrix satisfies RᵀR ≈ I and det(R) ≈ −1, within rounding tolerance. Applying the matrix twice should recover the original coordinates. CSV and PDF exports store your inputs, matrices, and sample points together. Use these checks when inputs come from measurements, slopes, or user‑entered coefficients.

FAQs

1) What does a reflection matrix do to a point?

It flips a point across a chosen axis, line, or plane while preserving distances. Points on the mirror remain unchanged, and the perpendicular component is reversed.

2) Why is the determinant usually −1?

Reflections preserve lengths but reverse orientation. That orientation flip makes the determinant negative, and for a pure reflection it is −1 (or close to −1 with rounding).

3) How do I reflect across a line defined by two points?

Enter the two points to define the mirror line. The calculator builds the line’s direction, finds a perpendicular normal, and constructs the affine reflection that keeps every point on the line fixed.

4) Why does the 3D output use a 4×4 matrix?

A 4×4 homogeneous matrix can represent both the linear reflection and any required translation for planes not passing through the origin. It also composes cleanly with other 3D transforms in one matrix product.

5) How can I quickly verify the result is correct?

Check that applying the matrix twice returns the original point. Also verify RᵀR is approximately the identity and the determinant is near −1 for reflections.

6) Why do the downloads sometimes differ from on‑screen values?

The table rounds values for readability. CSV and PDF exports keep higher precision, which is helpful when you later multiply matrices or compare against measured coordinates.

Note: Results are rounded for display; downloads contain full precision values.

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.