At a glance
This sim turns two points on a grid into one distance, Δs, using a rule applied to the coordinate differences Δx and Δy. Change one sign in that rule and it becomes the interval of spacetime, so this is the first step toward relativistic geometry.
What you'll learn
- How the two differences Δx and Δy are turned into a single distance.
- What the metric δᵢⱼ is, and what its entries mean.
- How the distance responds when you move the pair or turn the axes, and which numbers do change.
- What changes in the rule when space becomes spacetime.
What's on screen
- P₁ (cyan) and P₂ (amber): the two points, each labelled with its coordinates. They open at (1, 2) and (4, 6).
- Dashed legs Δx and Δy, meeting at a right angle.
- Blue segment: the straight line from P₁ to P₂. Its length is Δs, shown in a violet label once you compute it.
- View & readout and Compute Δs from the metric panels: the zoom toggle, the Distance readout, and the calculator.
The controls
Press ⌖ on a row to see where that control sits in the sim.
| Control | What it changes | Range | |
|---|---|---|---|
| Drag P₁, P₂ | Moves a point on the grid. It snaps to whole units, and cannot be dropped on the other point. Works in the Zoomed out view. | x, y: 0–8 opens at (1, 2) and (4, 6) | |
| Zoomed out / Zoomed in | Zoomed out shows the grid and both points. Zoomed in shows a schematic triangle of tiny steps dx, dy, ds, with the metric written out. It is not a magnified copy of the grid triangle. | 2 views opens Zoomed out | |
| Distance (readout) | Shows Δs in grid units once the Δx and Δy you typed match the points on the grid. | readout opens "Δs = ?" | |
| Δx, Δy (Compute Δs from the metric) | Type the differences x₂ − x₁ and y₂ − y₁. The sim works out Δs² and Δs step by step, and warns if your numbers do not match the grid. Moving a point clears them. | any whole number opens empty | |
| Speed | The scene is static, so nothing visible changes. | 0.25×–4× opens at 1× | |
| ↻ Reset | Puts P₁ and P₂ back at their opening positions and clears the calculator. | top bar |
Fixed: lengths are in grid units, and the grid runs from 0 to 8 on both axes.
The straight distance from squared legs
The blue segment is the hypotenuse of a right triangle whose legs are Δx and Δy:
These sliders fill in the sim's Compute Δs boxes.
- Square each difference, add, then take the root. For P₁ (1, 2) and P₂ (4, 6), Δx = 3 and Δy = 4, so Δs = √(9 + 16) = 5 grid units.
- Walking along the grid lines costs |Δx| + |Δy| = 7. Squaring before adding is what separates 5 from 7.
- The sign of a difference only records direction. Δx = −3 and Δx = +3 give the same Δs.
The metric is the rule for tiny steps
Written for infinitesimal steps, the rule is ds² = δᵢⱼ dxⁱ dxʲ. The array δᵢⱼ is the metric:
- Einstein notation: an index repeated once up and once down is summed. In 2D, δᵢⱼ dxⁱ dxʲ has four terms, and the two with i ≠ j are multiplied by 0.
- The 1s on the diagonal give dx² + dy². The 0s off the diagonal mean there is no dx dy cross term, which is what orthonormal axes ê₁, ê₂ provide.
- It is called the metric because it measures lengths and angles, through norms and inner products.
The sim's Zoomed in view draws this schematically: it is not a magnification of the 3-4-5 triangle.
Sliding the pair changes coordinates, not Δs
Coordinates are labels that depend on where the origin sits. The rule uses only differences, so moving both points by the same amount changes x₁, y₁, x₂ and y₂ but leaves Δx and Δy alone.
- Slide the opening pair by (+3, −1). P₁ goes from (1, 2) to (4, 1), and P₂ from (4, 6) to (7, 5). Still Δx = 3 and Δy = 4, so Δs = 5.
- Moving the origin is the same thing seen from the other side: every coordinate shifts by one fixed amount, and the differences do not.
- Distance belongs to the separation, not to where the pair happens to sit.
Turning the axes changes components, not length
The same metric gives the length of any vector, and the angle between two. Observers whose Cartesian axes are rotated relative to each other write different components for the same vector, and get the same length.
- Turn the figure. Rotating the separation (3, 4) by 90° gives (−4, 3). Both components change, and Δs = 5 either way.
- Turn the axes. Bob writes a particle's velocity as (v/√2)(1, 1). Alice's axes are rotated, so she writes (v, 0). Bob finds ½v² + ½v² = v², and Alice finds v²: the same speed.
- This works because δᵢⱼ is the same array in every Cartesian frame, so the number it returns is agreed on by all of them.
Zero separation means one point, until a sign flips
Both terms in Δs² = Δx² + Δy² are squares, so neither can be negative. Δs = 0 only when Δx = 0 and Δy = 0: P₁ and P₂ are the same point. A rule with this property is positive-definite. Sharing a grid line is not enough: with Δx = 0 and Δy = 4, Δs = 4.
Spacetime keeps the shape of the rule and flips one sign. In spacetime the time term is negative and the space terms are positive (c is the speed of light):
- With a minus sign the two terms can cancel. Two distinct events with Δx = cΔt have Δs² = 0: the separation a light ray covers.
- Only differences still appear, so the interval is unchanged by sliding both events. What is lost is positive-definiteness.
This sim draws only the plane. The spacetime rule is stated here, not shown.
Where it matters
- Distances from coordinates. Graphics, surveying and robotics all find the straight-line distance between two points this way. Rotating the camera or the map leaves those distances unchanged.
- Speed in any frame. Velocity components depend on the axes, but the speed does not, as in the Bob and Alice example.
- Spacetime. The interval Δs² = −c²Δt² + Δx² + Δy² + Δz² is the same rule with one sign flipped, and it is the quantity every inertial observer agrees on.
Go deeper: the metric in other coordinates
- In polar coordinates the same plane has ds² = dr² + r² dθ². The metric's components are no longer the identity.
- So δᵢⱼ is unchanged under the moves between Cartesian frames, such as translations and rotations. That is a narrower claim than "invariant in every coordinate system".
Summary
Key points
- Δs = √(Δx² + Δy²). The grid path |Δx| + |Δy| is longer unless one leg is zero.
- δᵢⱼ, with ones on the diagonal and zeros elsewhere, is the metric of Cartesian coordinates.
- Only differences enter, and δᵢⱼ is the same in every Cartesian frame, so Δs survives sliding and turning.
- Δs = 0 only for coincident points. In spacetime, one sign flip lets distinct events have zero interval.
Common mix-ups
- "The distance is |Δx| + |Δy|." That is the grid path, 7 for the opening pair. The metric squares before it adds, so Δs = 5.
- "Different components mean a different length." Components depend on the axes. The length does not.
- "δᵢⱼ never changes." It is unchanged between Cartesian frames. In polar coordinates the components of the metric change.
Things to try on your own
- Find a pair of points whose Δs equals |Δx| + |Δy|. Describe what all such pairs have in common.
- Start from Δx = 3 and Δy = 4. Double Δx and halve Δy, drag P₂ to match, and compute Δs. Compare it with 5.