The forward transform
A 2D similarity transform does three things in a fixed order: scale the point, rotate it, then translate it. Writing that as equations makes the inverse obvious, because each operation is individually undoable.
y′ = s·(x·sin θ + y·cos θ) + t_y
This is the standard rotate-scale-translate composition used by graphics APIs, CAD tools and surveying software. Two parameters for the rotation, one for the uniform scale and two for the translation — five numbers that fully describe the mapping.
Undoing it in reverse order
To invert a composition, undo the last operation first. Translation was applied last, so subtract it first. Scale came before rotation, so divide before rotating back.
- Subtract the translation: (x′ − tₓ, y′ − t_y).
- Divide by the scale: dx = (x′ − tₓ)/s and dy = (y′ − t_y)/s.
- Rotate by −θ. Since the rotation matrix is orthogonal, its inverse is its transpose, so the formulas are x = dx·cos θ + dy·sin θ and y = −dx·sin θ + dy·cos θ.
Order matters, and getting it wrong looks plausible. Applying the three inverses in the wrong order still produces a number, so the error is silent. The tool assumes the forward order was translate ∘ rotate ∘ scale; if your pipeline differs, you must reverse the steps to match.
Worked example
A point lands at (3, 4) after a 90° rotation, a scale of 2 and a translation of (1, 1). Undo the translation: (2, 3). Undo the scale: (1, 1.5). Now rotate by −90°, which maps (dx, dy) to (dy, −dx), giving (1.5, −1).
| Step | Operation | Result |
|---|---|---|
| Start | transformed point | (3, 4) |
| 1 | subtract (1, 1) | (2, 3) |
| 2 | divide by s = 2 | (1, 1.5) |
| 3 | rotate by −90° | (1.5, −1) |
Checking forward: scale gives (3, −2), rotating 90° gives (2, 3), translating by (1, 1) gives (3, 4). The tool performs this check automatically and reports the result, so a mismatch is visible immediately.
Why the rotation inverse is a transpose
A rotation matrix has orthonormal columns, which means its transpose equals its inverse. In practice that saves you from ever computing a matrix inverse for a rotation — you flip the sign of the angle and the job is done.
This is a special case of a general fact: for any orthogonal matrix, MᵀM = I. Rotations, reflections and their products all have this property, which is why they are numerically stable to invert even after many compositions. A general 2×2 matrix offers no such guarantee and can be arbitrarily ill-conditioned.
The scale is where trouble can enter. A scale of zero collapses the entire plane onto a single point, so no inverse exists — the tool rejects it. A very small scale is technically invertible but amplifies any measurement error by 1/s.
Where this arises
- Surveying — converting a coordinate measured in a rotated site grid back into national grid coordinates.
- CAD and GIS — clicking on a transformed object and needing its position in the object's own frame.
- Robotics — converting a target given in world coordinates into the robot's local frame.
- Image registration — after aligning two images, mapping features from one back into the other's frame.
- Game engines — converting a mouse click in screen space into world space through the inverse of the camera transform.
In all of these the pattern is the same: you have a point in the transformed frame and need it in the original one. Five numbers and three steps recover it exactly.
Frequently asked questions
Why is the translation undone first?
Because it was applied last. Inverting a composition means reversing the order of the operations as well as each one individually — subtract the translation, then divide by the scale, then rotate back.
What happens if the scale is zero?
The transform is not invertible. Scaling by zero maps every point to the origin, destroying all positional information, so there is no way to recover the original coordinates.
Can the scale be negative?
Yes, and it means a reflection as well as a resize. The inverse divides by the negative scale, which restores the original orientation correctly.
Does the rotation direction matter?
Yes. This tool uses the standard mathematical convention of counter-clockwise positive angles. If your software treats clockwise as positive, enter the negated angle.
What if the transform also includes a shear?
Then it is a general affine transform rather than a similarity, and these five parameters no longer describe it. You would need the full 2×3 matrix and to invert that instead.