{
  "id": "midpoint",
  "version": "78e0497537d5",
  "status": "published",
  "name": "Midpoint Calculator",
  "question": "What is the midpoint?",
  "summary": "Finds the midpoint of two points on a plane and the distance between them, or the other endpoint from one endpoint and the midpoint.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/midpoint-calculator",
  "markdown": "https://www.acalculator.org/math/midpoint-calculator.md",
  "kind": "function",
  "method": "M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2); from A and M, B = (2 × Mx − x₁, 2 × My − y₁).",
  "assumptions": [
    "Points on a flat plane with x and y coordinates in the same unit.",
    "The distance is the straight-line (Euclidean) distance from A to B."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "find": {
        "title": "What do you want to find?",
        "description": "The midpoint of two points, or the second endpoint from the first endpoint and the midpoint.",
        "type": "string",
        "enum": [
          "midpoint",
          "endpoint"
        ]
      },
      "x1": {
        "title": "Point A: x",
        "description": "The x-coordinate of the first point, A.",
        "type": "number"
      },
      "y1": {
        "title": "Point A: y",
        "description": "The y-coordinate of the first point, A.",
        "type": "number"
      },
      "x2": {
        "title": "Point B: x",
        "description": "The x-coordinate of the second point, B.",
        "type": "number"
      },
      "y2": {
        "title": "Point B: y",
        "description": "The y-coordinate of the second point, B.",
        "type": "number"
      },
      "mx": {
        "title": "Midpoint M: x",
        "description": "The x-coordinate of the midpoint, M.",
        "type": "number"
      },
      "my": {
        "title": "Midpoint M: y",
        "description": "The y-coordinate of the midpoint, M.",
        "type": "number"
      }
    }
  },
  "outputs": {
    "mx": {
      "label": "Midpoint: x",
      "description": "The x-coordinate of the midpoint: (x₁ + x₂) ÷ 2.",
      "format": "number"
    },
    "my": {
      "label": "Midpoint: y",
      "description": "The y-coordinate of the midpoint: (y₁ + y₂) ÷ 2.",
      "format": "number"
    },
    "x2": {
      "label": "Point B: x",
      "description": "The x-coordinate of the other endpoint: 2 × Mx − x₁.",
      "format": "number"
    },
    "y2": {
      "label": "Point B: y",
      "description": "The y-coordinate of the other endpoint: 2 × My − y₁.",
      "format": "number"
    },
    "distance": {
      "label": "Distance from A to B",
      "description": "The straight-line length of the segment AB: √((x₂ − x₁)² + (y₂ − y₁)²).",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "find": "midpoint",
      "x1": 2,
      "y1": 3,
      "x2": 8,
      "y2": 5,
      "mx": 5,
      "my": 4
    },
    "outputs": {
      "mx": 5,
      "my": 4,
      "distance": 6.324555320336759
    },
    "text": "The midpoint of (2, 3) and (8, 5) is (5, 4)."
  },
  "examples": [
    {
      "given": {
        "find": "midpoint",
        "x1": 2,
        "y1": 3,
        "x2": 8,
        "y2": 5
      },
      "expect": {
        "mx": 5,
        "my": 4,
        "distance": 6.324555320336759
      },
      "source": "hand calculation in content.mdx: ((2 + 8) ÷ 2, (3 + 5) ÷ 2) = (5, 4); √(6² + 2²) = √40; OpenStax, College Algebra 2e, §2.1 The Rectangular Coordinate Systems and Graphs (distance and midpoint formulas). https://openstax.org/books/college-algebra-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs"
    },
    {
      "given": {
        "find": "midpoint",
        "x1": -4,
        "y1": 3,
        "x2": 6,
        "y2": -7
      },
      "expect": {
        "mx": 1,
        "my": -2,
        "distance": 14.142135623730951
      },
      "source": "hand calculation in content.mdx: ((−4 + 6) ÷ 2, (3 − 7) ÷ 2) = (1, −2); √(10² + 10²) = √200; OpenStax, College Algebra 2e, §2.1 The Rectangular Coordinate Systems and Graphs (distance and midpoint formulas). https://openstax.org/books/college-algebra-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs"
    },
    {
      "given": {
        "find": "midpoint",
        "x1": 0.1,
        "y1": 0.2,
        "x2": 0.3,
        "y2": 0.4
      },
      "expect": {
        "mx": 0.2,
        "my": 0.30000000000000004
      },
      "source": "hand calculation in content.mdx: (0.2, 0.3); Python 3: (0.2 + 0.4) / 2 = 0.30000000000000004; OpenStax, College Algebra 2e, §2.1 The Rectangular Coordinate Systems and Graphs (distance and midpoint formulas). https://openstax.org/books/college-algebra-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs"
    },
    {
      "given": {
        "find": "endpoint",
        "x1": 2,
        "y1": 3,
        "mx": 5,
        "my": 4
      },
      "expect": {
        "x2": 8,
        "y2": 5
      },
      "source": "hand calculation in content.mdx: (2 × 5 − 2, 2 × 4 − 3) = (8, 5); OpenStax, College Algebra 2e, §2.1 The Rectangular Coordinate Systems and Graphs (distance and midpoint formulas). https://openstax.org/books/college-algebra-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs"
    }
  ],
  "sources": [
    "OpenStax, College Algebra 2e, §2.1 The Rectangular Coordinate Systems and Graphs (distance and midpoint formulas). https://openstax.org/books/college-algebra-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs"
  ],
  "related": [],
  "changelog": [
    {
      "date": "2026-09-29",
      "note": "Worked examples name a published reference for their rule."
    }
  ]
}
