{
  "id": "endpoint",
  "version": "cbad5bc854d7",
  "status": "published",
  "name": "Endpoint Calculator",
  "question": "What is the other endpoint?",
  "summary": "Finds the other endpoint of a line segment from one endpoint and the midpoint, B = 2M − A, in 2D or 3D, in exact fractions, with the segment’s length.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/endpoint-calculator",
  "markdown": "https://www.acalculator.org/math/endpoint-calculator.md",
  "kind": "function",
  "method": "B = 2M − A: x₂ = 2Mx − x₁, y₂ = 2My − y₁ (and z₂ = 2Mz − z₁ in 3D), from the midpoint formula M = (A + B) ÷ 2.",
  "assumptions": [
    "Every number is read exactly as typed (0.1 is 1/10), so B is exact. Coordinates are within ±10¹².",
    "The length of AB is the straight-line (Euclidean) distance, a double-precision number.",
    "In 3D the plot shows the x and y coordinates only (the view from above)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "d": {
        "title": "Points in",
        "description": "A flat plane (x, y) or space (x, y, z).",
        "type": "string",
        "enum": [
          "2",
          "3"
        ]
      },
      "x1": {
        "title": "Endpoint A: x",
        "description": "The x coordinate of the endpoint you know, A.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "y1": {
        "title": "Endpoint A: y",
        "description": "The y coordinate of A.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "z1": {
        "title": "Endpoint A: z",
        "description": "The z coordinate of A.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "mx": {
        "title": "Midpoint M: x",
        "description": "The x coordinate of the midpoint, M.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "my": {
        "title": "Midpoint M: y",
        "description": "The y coordinate of M.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "mz": {
        "title": "Midpoint M: z",
        "description": "The z coordinate of M.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      }
    }
  },
  "outputs": {
    "endpoint": {
      "label": "Other endpoint B",
      "description": "B = 2M − A, coordinate by coordinate, as exact fractions.",
      "format": "text"
    },
    "x2": {
      "label": "B: x",
      "description": "x₂ = 2 × Mx − x₁.",
      "format": "number"
    },
    "y2": {
      "label": "B: y",
      "description": "y₂ = 2 × My − y₁.",
      "format": "number"
    },
    "z2": {
      "label": "B: z",
      "description": "z₂ = 2 × Mz − z₁, in 3D.",
      "format": "number"
    },
    "length": {
      "label": "Length of AB",
      "description": "The straight-line distance from A to B: twice the distance from A to M.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "d": "2",
      "x1": 7,
      "y1": -2,
      "z1": 0,
      "mx": 8,
      "my": 1.5,
      "mz": 0
    },
    "outputs": {
      "endpoint": "(9, 5)",
      "x2": 9,
      "y2": 5,
      "length": 7.280109889280519
    },
    "text": "The other endpoint is B = (9, 5)."
  },
  "examples": [
    {
      "given": {
        "d": "2",
        "x1": 7,
        "y1": -2,
        "mx": 8,
        "my": 1.5
      },
      "expect": {
        "endpoint": "(9, 5)",
        "x2": 9,
        "y2": 5,
        "length": 7.280109889280518
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §2.1 The Rectangular Coordinate Systems and Graphs (midpoint formula M = ((x₁ + x₂)/2, (y₁ + y₂)/2); the midpoint of (7, −2) and (9, 5) is (8, 3/2)), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs (retrieved 2026-10-02); hand calculation in content.mdx: (2 × 8 − 7, 2 × 3/2 − (−2)) = (9, 5); Python 3: math.hypot(2, 7)"
    },
    {
      "given": {
        "d": "2",
        "x1": 2,
        "y1": 3,
        "mx": 5,
        "my": 4
      },
      "expect": {
        "endpoint": "(8, 5)",
        "length": 6.324555320336759
      },
      "source": "hand calculation in content.mdx: (2 × 5 − 2, 2 × 4 − 3) = (8, 5); OpenStax, Algebra and Trigonometry 2e, §2.1 The Rectangular Coordinate Systems and Graphs (midpoint formula M = ((x₁ + x₂)/2, (y₁ + y₂)/2); the midpoint of (7, −2) and (9, 5) is (8, 3/2)), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs (retrieved 2026-10-02)"
    },
    {
      "given": {
        "d": "3",
        "x1": 1,
        "y1": -1,
        "z1": 2,
        "mx": 0.5,
        "my": 0.25,
        "mz": -1
      },
      "expect": {
        "endpoint": "(0, 3/2, −4)",
        "x2": 0,
        "y2": 1.5,
        "z2": -4,
        "length": 6.576473218982953
      },
      "source": "hand calculation in content.mdx: (2 × 0.5 − 1, 2 × 0.25 + 1, 2 × (−1) − 2) = (0, 3/2, −4); OpenStax, Algebra and Trigonometry 2e, §2.1 The Rectangular Coordinate Systems and Graphs (midpoint formula M = ((x₁ + x₂)/2, (y₁ + y₂)/2); the midpoint of (7, −2) and (9, 5) is (8, 3/2)), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs (retrieved 2026-10-02)"
    },
    {
      "given": {
        "d": "2",
        "x1": 0.1,
        "y1": 0.2,
        "mx": 0.15,
        "my": 0.3
      },
      "expect": {
        "endpoint": "(1/5, 2/5)",
        "x2": 0.2,
        "y2": 0.4
      },
      "source": "hand calculation in content.mdx: decimals are exact, 2 × 0.15 − 0.1 = 0.2 and 2 × 0.3 − 0.2 = 0.4; OpenStax, Algebra and Trigonometry 2e, §2.1 The Rectangular Coordinate Systems and Graphs (midpoint formula M = ((x₁ + x₂)/2, (y₁ + y₂)/2); the midpoint of (7, −2) and (9, 5) is (8, 3/2)), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs (retrieved 2026-10-02)"
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §2.1 The Rectangular Coordinate Systems and Graphs (midpoint formula M = ((x₁ + x₂)/2, (y₁ + y₂)/2); the midpoint of (7, −2) and (9, 5) is (8, 3/2)). https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs (retrieved 2026-10-02)"
  ],
  "related": [
    "midpoint",
    "distance-formula",
    "slope-intercept-form"
  ],
  "changelog": []
}
