ForHosting KIT · Math

Reflect a point over y=x calculator

Enter a point and get its mirror image across the diagonal line y = x: (3, 7) becomes (7, 3), because the two coordinates simply trade places. Points on the line stay where they are. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
X
3
Y
7
You get
Reflected x
7
Reflected y
3

Reflecting a point over the line y equals x is one of the first isometries students meet in coordinate geometry: the image of P equals open parenthesis x comma y close parenthesis is simply the point with coordinates swapped, so P prime equals open parenthesis y comma x close parenthesis. That single swap is the matrix transpose of a column vector, the inverse of the same map, and the geometric flip across the main diagonal of the plane.

What reflection over y equals x means and why people search for it

In Euclidean plane geometry the line y equals x is the set of points whose two coordinates are equal. Reflecting a point P equals open parenthesis x comma y close parenthesis across that diagonal produces the unique point P prime that lies on the opposite side of the line at the same perpendicular distance, with the segment PP prime perpendicular to the diagonal.

Algebraically the map is the coordinate swap P prime equals open parenthesis y comma x close parenthesis: the x-axis and y-axis trade places, so every horizontal offset becomes a vertical offset and vice versa. Search intent clusters around phrases such as reflect a point over y equals x, reflection over the line y equals x calculator, swap coordinates reflection, and find the image of a point across the main diagonal.

Where the diagonal reflection comes in handy

Classrooms and tutoring platforms use a reflect-over-y-equals-x calculator so learners can check the image of arbitrary points without flipping sign errors by hand when they confuse reflection over y equals x with reflection over the origin or over an axis. Exam-prep generators need a deterministic oracle that rejects non-finite coordinates instead of silently coercing bad strings. Failed validation does not consume balance.

Coordinates may be any finite numbers within a large absolute bound suitable for ordinary classroom and CAD figures; the response shares the same unit system you already use. Keep requests small, pin the rounded fields in tests, and you get reproducible reflections for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own.

Classroom and homework reflection drills

Students submit x and y for a point and verify the image across y=x as (y,x), including rejection when a coordinate is missing or non-numeric.

Exam and LMS auto-grading

Mark coordinate-geometry items with a deterministic oracle that swaps axes correctly and never invents a reflection from invalid input.

What formula does the calculator use?

Reflection over y=x is the coordinate swap (x,y) → (y,x).

What is the reflection of (3, 7) over the line y = x?

It is (7, 3). Reflecting across that diagonal swaps the two coordinates, so the first becomes the second and the second becomes the first.

Why do the coordinates just swap places?

The line is made of the points whose two coordinates are equal. Mirroring across it makes the two axes trade places, so every horizontal offset becomes a vertical one and the other way round.

What if the point is already on the line?

When both coordinates are equal, swapping them changes nothing, so the image is the same point. The calculator also marks that the point lies on the line.

Does reflecting the image again undo the swap?

Yes. The swap is its own inverse: exchanging the coordinates of (7, 3) gives back (3, 7), the point you started from.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geom/reflect-point-yx

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geom/reflect-point-yx \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"x":3,"y":7}'
{
  "x": 3,
  "y": 7
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geom.reflect_point_yx",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This calculator accepts two finite numbers x and y, rejects missing or non-numeric coordinates with invalid_input so failed validation is never charged, and returns the reflected pair together with a flag when the original point already lies on the diagonal.

What reflection over y equals x means and why people search for it

Delivering reflected_x and reflected_y as JSON makes the result easy to diff in continuous integration, feed into a larger pipeline, or copy into notes. Points already on the line are fixed points of the isometry, and the response marks that case with on_line true so clients can special-case UI without a second comparison.

Input contract, response shape, and validation behaviour

POST a JSON body with two required finite numbers: x, the abscissa of the point to reflect, and y, the ordinate. Each field may arrive as a JSON number or as a numeric string; missing fields, empty strings, NaN, and infinities fail with invalid_input naming the field so those failed calls are not charged. After parsing, the reflected point is computed as reflected_x equals y and reflected_y equals x. Results are rounded to a stable decimal precision so the same coordinates always yield the same JSON across JavaScript engines. The response echoes the input coordinates, returns reflected_x and reflected_y, sets on_line to true when x equals y, sets method to swap_coordinates, and includes a short formula string restating the identity for display next to the answer. Example: x equals three and y equals seven yields reflected_x equals seven and reflected_y equals three because the diagonal swaps the pair. Example on the line: x equals four and y equals four yields the same point with on_line true. There is no trigonometry, no matrix library, and no external geometry service—only a coordinate swap on a Worker isolate. Pair the response with your own plotting code if you need a sketch of the segment from P to P prime; this endpoint returns numbers only and does not emit plots or multi-step prose beyond the formula field.

Where a y equals x reflection API earns its keep, pricing, and limits

Engineering notebooks, CAD helpers, and game editors often reduce transpose-style transforms and diagonal symmetry checks to this single map when validating that a figure is symmetric across the main diagonal; calling a tiny parse API avoids pulling a full computer-algebra system for a two-number problem.

CAD, mesh, and game diagonal symmetry checks

Tools that test symmetry across the main diagonal or apply a transpose-style transform can recover the reflected point as structured JSON.

How do I reflect a point over y equals x with this API?

Send a JSON body with finite numbers x and y. The response returns reflected_x = y and reflected_y = x, the image of (x,y) across the line y=x.

What happens if a coordinate is missing or not a number?

The request fails with invalid_input because a finite number is required for every field. Those validation failures are not charged.

What if the point already lies on y equals x?

The reflected point equals the original point and on_line is true. That is a fixed point of the isometry, not an error.

What does the reflect-over-y-equals-x calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →