Logo

MonoCalc

/

Line Reflection Calculator

Geometry

Quick Presets

Point to Reflect

Reflected X

3

Reflected Y

-4

Perpendicular Foot F

(3, 0)

Distance P → P'

8 units

Line Equation

y = 0

Diagram

FPP'

About This Tool

Line Reflection Calculator – Mirror a Point Across Any Line

A line reflection creates a mirror image of a point on the opposite side of a fixed line, at the same perpendicular distance. Unlike a point reflection (which mirrors through a single center), a line reflection uses an entire line — an axis, a diagonal, or any arbitrary line — as the axis of symmetry. This calculator supports reflections across the x-axis, y-axis, y = x, y = −x, custom slope-intercept lines, lines defined by two points, and vertical or horizontal lines.

The General Reflection Formula

Every line can be written in standard form ax + by + c = 0. Given a point P(px, py), the calculator first finds the foot of the perpendicular from P to the line:

k = (a·px + b·py + c) / (a² + b²)
foot_x = px − a·k
foot_y = py − b·k

The foot F is the midpoint between P and its reflection, so doubling it and subtracting the original point gives the mirrored coordinates:

reflected_x = 2·foot_x − px
reflected_y = 2·foot_y − py

Special Cases: Axes and Diagonals

For common lines, the general formula simplifies considerably. Reflecting across the x-axis (y = 0) negates the y-coordinate: (x, y) → (x, −y). Reflecting across the y-axis (x = 0) negates the x-coordinate: (x, y) → (−x, y). Reflecting across y = x swaps the coordinates: (x, y) → (y, x). And reflecting across y = −x swaps and negates both: (x, y) → (−y, −x). For example, the point (3, 4) reflects to (3, −4) across the x-axis, (−3, 4) across the y-axis, (4, 3) across y = x, and (−4, −3) across y = −x.

Vertical and Horizontal Lines

A vertical line x = c only flips the x-coordinate: reflected_x = 2c − px, reflected_y = py. A horizontal line y = c only flips the y-coordinate: reflected_x = px, reflected_y = 2c − py. For instance, reflecting (5, 3) across x = 2 gives (−1, 3), and reflecting (4, 7) across y = 3 gives (4, −1).

Slope-Intercept and Two-Point Lines

For a line in slope-intercept form y = mx + b, the calculator rewrites it as mx − y + b = 0 (so a = m, b_coeff = −1, c = b) before applying the general formula. For a line defined by two points, the standard-form coefficients are derived directly from the coordinates of both points, which is useful when you know two points on a mirror line rather than its slope and intercept.

Reflection preserves distance
Because the foot of the perpendicular is always the midpoint between a point and its reflection, the distance from the original point to the line equals the distance from the line to the reflected point. If the original point already lies on the line, the reflected point equals the original point.

Common Applications

  • Coordinate geometry education — understanding lines of symmetry and perpendicular projections
  • Computer graphics — mirroring shapes or sprites across an arbitrary axis
  • Optics and physics — modeling how light or particles reflect off a straight surface
  • CAD and vector design — generating symmetric control points across a reference line

Precision and Accuracy

Calculations use standard 64-bit floating-point arithmetic, accurate to about 15 significant digits. You can choose a display precision from 2 to 6 decimal places. Very steep slopes (magnitude above 10,000) can introduce numerical instability in slope-intercept mode — switch to vertical-line mode for an exact result in that case.

Frequently Asked Questions

Is the Line Reflection Calculator free?

Yes, Line Reflection Calculator is totally free :)

Can I use the Line Reflection Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Line Reflection Calculator?

Yes, any data related to Line Reflection Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does this line reflection calculator work?

Enter a point and choose how to define the mirror line — a preset axis, slope-intercept form, two points, or a vertical/horizontal line. The calculator converts the line to standard form ax + by + c = 0, finds the perpendicular foot from your point to the line, and doubles that foot to get the reflected point.

What is the formula for reflecting a point across a line?

For a line in standard form ax + by + c = 0 and a point P(px, py), the foot of the perpendicular is F = (px − a·k, py − b·k) where k = (a·px + b·py + c)/(a² + b²). The reflected point is then P' = (2·Fx − px, 2·Fy − py).

What happens if my point already lies on the line?

If the point lies exactly on the reflection line, the reflected point equals the original point since the line acts as its own mirror image at that location. The calculator shows a notice when this occurs.

Why does the calculator warn about steep slopes?

When the slope magnitude is extremely large (greater than 10,000), the line is nearly vertical and slope-intercept form becomes numerically unstable. Switching to Vertical Line mode (x = c) gives an exact, stable result in that case.

Can I reflect a point across a line defined by two points?

Yes. Two-Point mode derives the standard-form line equation directly from any two distinct points and reflects your point across that line. The two points must not be identical, since that would not define a unique line.

How accurate are the reflected coordinates?

Calculations use JavaScript's 64-bit floating-point arithmetic (IEEE 754), accurate to about 15 significant digits. Displayed values are rounded to your chosen precision, from 2 to 6 decimal places.