Endpoint Calculator
Enter one known endpoint and the midpoint of a line segment to instantly find the other endpoint. The calculator works in 2D (x, y) or 3D (x, y, z), shows every step of the algebra, and also computes the full segment length between the two endpoints. Results update as you type.
Formula
Worked example
Given P₁ = (1, 3) and midpoint M = (3, 5): x₂ = 2(3) - 1 = 5, y₂ = 2(5) - 3 = 7. Missing endpoint is (5, 7). Segment length: √((5-1)² + (7-3)²) = √(16 + 16) = √32 ≈ 5.657 units.
What is an endpoint calculator?
An endpoint calculator finds the second endpoint of a line segment when you know only one endpoint and the midpoint. In coordinate geometry, a line segment has exactly two endpoints connected by a straight line, and its midpoint sits exactly halfway between them. If you are given the midpoint and one endpoint, a simple rearrangement of the midpoint formula recovers the missing coordinate pair. This calculator handles both 2D (x, y) and 3D (x, y, z) geometry and also computes the total segment length for you.
How the endpoint formula is derived
The midpoint of a segment with endpoints P₁(x₁, y₁) and P₂(x₂, y₂) is M = ((x₁+x₂)/2, (y₁+y₂)/2). Rearranging for x₂ gives x₂ = 2xₘ - x₁, and similarly y₂ = 2yₘ - y₁. The same logic extends to 3D: z₂ = 2zₘ - z₁. Once both endpoints are known, the segment length follows from the Pythagorean theorem: d = square root of ((x₂-x₁)² + (y₂-y₁)²) in 2D, with the z-term added for 3D.
Worked example step by step
Suppose one endpoint is P₁ = (1, 3) and the midpoint is M = (3, 5). Step 1: x₂ = 2(3) - 1 = 6 - 1 = 5. Step 2: y₂ = 2(5) - 3 = 10 - 3 = 7. The missing endpoint is P₂ = (5, 7). Verify by averaging: ((1+5)/2, (3+7)/2) = (3, 5), which matches M. The segment length is the square root of (5-1)² + (7-3)² = the square root of 32, approximately 5.657 units.
Where endpoint calculations appear
Finding a missing endpoint comes up whenever a segment is defined by its center rather than its edges, for example locating the far end of a diameter given the center and one point on a circle, splitting distances in navigation and mapping, or computing the reflected position of a point across a given mirror point in computer graphics. In physics, it models the other end of a displacement vector from a midpoint observation. The 3D version is used in 3D modeling and game development to find vertices from known face centers.
Endpoint and midpoint formulas
| Formula name | Expression | What it finds |
|---|---|---|
| Midpoint (2D) | M = ((x₁+x₂)/2, (y₁+y₂)/2) | Midpoint from two endpoints |
| Missing endpoint x | x₂ = 2xₘ - x₁ | x-coordinate of P₂ |
| Missing endpoint y | y₂ = 2yₘ - y₁ | y-coordinate of P₂ |
| Distance (2D) | d = √((x₂-x₁)² + (y₂-y₁)²) | Segment length |
| Distance (3D) | d = √((x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²) | 3D segment length |
| Slope | m = (y₂-y₁) / (x₂-x₁) | Steepness of the segment |
Key coordinate geometry formulas for a segment with endpoints P₁(x₁, y₁) and P₂(x₂, y₂) and midpoint M(xₘ, yₘ).
Frequently asked questions
What is the formula for a missing endpoint?
If you know one endpoint P₁(x₁, y₁) and the midpoint M(xₘ, yₘ), the missing endpoint coordinates are: x₂ = 2xₘ - x₁ and y₂ = 2yₘ - y₁. For 3D, add z₂ = 2zₘ - z₁. These come directly from rearranging the standard midpoint formula.
How do I verify my answer?
Once you have P₂, average the x-coordinates of P₁ and P₂: (x₁ + x₂) / 2. Do the same for y (and z in 3D). The result should equal the midpoint you started with. This calculator performs that check automatically and displays the midpoint confirmation alongside your answer.
Can the missing endpoint and the midpoint be the same point?
Yes, but only if P₁ is also the midpoint, meaning the segment has zero length and both "endpoints" are the same point. That is a degenerate case (a single point, not a true segment).
Does the formula work for negative coordinates?
Yes. The formula x₂ = 2xₘ - x₁ works for any real numbers, positive, negative, or zero. For example, with P₁ = (-4, 2) and M = (0, -1): x₂ = 2(0) - (-4) = 4, y₂ = 2(-1) - 2 = -4, so P₂ = (4, -4).
How is the segment length calculated once I have both endpoints?
Use the distance formula: d = the square root of (x₂-x₁)² + (y₂-y₁)² in 2D. In 3D, add the (z₂-z₁)² term under the square root. The formula is an application of the Pythagorean theorem to the horizontal and vertical (and depth) differences between the two points.
What is the difference between a midpoint calculator and an endpoint calculator?
A midpoint calculator takes two known endpoints and returns their midpoint. An endpoint calculator takes one known endpoint and the midpoint and returns the missing endpoint. They are inverses of each other, both based on the same midpoint formula rearranged in opposite directions.