{
  "id": "orthocenter",
  "version": "336ba245f3b3",
  "status": "published",
  "name": "Orthocenter Calculator",
  "question": "Where is my triangle’s orthocenter?",
  "summary": "Finds the orthocenter of a triangle from the coordinates of its three vertices: the point where the three altitudes meet, as exact fractions, with the altitude equations and whether it lies inside, on or outside the triangle.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/orthocenter-calculator",
  "markdown": "https://www.acalculator.org/math/orthocenter-calculator.md",
  "kind": "function",
  "method": "Altitude from A: (C − B)·(P − A) = 0; altitude from B: (C − A)·(P − B) = 0. Solving the two for P gives the orthocenter H.",
  "assumptions": [
    "Coordinates are read as the exact decimals typed, so H is an exact fraction.",
    "The three points must not lie on one line."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "ax": {
        "title": "A: x",
        "description": "The x-coordinate of vertex A.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "ay": {
        "title": "A: y",
        "description": "The y-coordinate of vertex A.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "bx": {
        "title": "B: x",
        "description": "The x-coordinate of vertex B.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "by": {
        "title": "B: y",
        "description": "The y-coordinate of vertex B.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "cx": {
        "title": "C: x",
        "description": "The x-coordinate of vertex C.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "cy": {
        "title": "C: y",
        "description": "The y-coordinate of vertex C.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      }
    }
  },
  "outputs": {
    "orthocenter": {
      "label": "Orthocenter H",
      "description": "Where the three altitudes meet, as exact fractions.",
      "format": "text"
    },
    "hx": {
      "label": "H: x",
      "description": "The x-coordinate of the orthocenter, as a decimal.",
      "format": "number"
    },
    "hy": {
      "label": "H: y",
      "description": "The y-coordinate of the orthocenter, as a decimal.",
      "format": "number"
    },
    "where": {
      "label": "Where H lies",
      "description": "Inside an acute triangle, at the right-angle vertex, or outside an obtuse triangle.",
      "format": "text"
    },
    "altA": {
      "label": "Altitude from A",
      "description": "The line through A perpendicular to BC.",
      "format": "text"
    },
    "altB": {
      "label": "Altitude from B",
      "description": "The line through B perpendicular to CA.",
      "format": "text"
    },
    "altC": {
      "label": "Altitude from C",
      "description": "The line through C perpendicular to AB.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "ax": 0,
      "ay": 0,
      "bx": 4,
      "by": 0,
      "cx": 1,
      "cy": 3
    },
    "outputs": {
      "orthocenter": "(1, 1)",
      "hx": 1,
      "hy": 1,
      "where": "Inside: an acute triangle",
      "altA": "x − y = 0",
      "altB": "x + 3y = 4",
      "altC": "x = 1"
    },
    "text": "The orthocenter of the triangle is H = (1, 1)."
  },
  "examples": [
    {
      "given": {
        "ax": 0,
        "ay": 0,
        "bx": 4,
        "by": 0,
        "cx": 1,
        "cy": 3
      },
      "expect": {
        "orthocenter": "(1, 1)",
        "where": "Inside: an acute triangle",
        "altA": "x − y = 0",
        "altB": "x + 3y = 4",
        "altC": "x = 1"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §2.2 Linear Equations in One Variable (perpendicular lines: the product of the slopes is −1; writing the equation of a line perpendicular to a given line through a point), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-2-linear-equations-in-one-variable (retrieved 2026-10-02); Altitude (triangle), Wikipedia (the orthocenter is where the three altitudes intersect; inside an acute triangle, at the right-angle vertex of a right triangle), https://en.wikipedia.org/wiki/Altitude_(triangle) (retrieved 2026-10-02); hand calculation in content.mdx: the altitude from C is x = 1; BC has slope −1, so the altitude from A has slope 1, y = x; H = (1, 1)"
    },
    {
      "given": {
        "ax": 0,
        "ay": 0,
        "bx": 4,
        "by": 0,
        "cx": 0,
        "cy": 3
      },
      "expect": {
        "orthocenter": "(0, 0)",
        "where": "On vertex A: a right triangle, right angle at A"
      },
      "source": "Altitude (triangle), Wikipedia (the orthocenter is where the three altitudes intersect; inside an acute triangle, at the right-angle vertex of a right triangle), https://en.wikipedia.org/wiki/Altitude_(triangle) (retrieved 2026-10-02); hand calculation in content.mdx: the legs AB and AC are altitudes and meet at A"
    },
    {
      "given": {
        "ax": 0,
        "ay": 0,
        "bx": 6,
        "by": 0,
        "cx": 1,
        "cy": 1
      },
      "expect": {
        "orthocenter": "(1, 5)",
        "hy": 5,
        "where": "Outside: an obtuse triangle, obtuse angle at C"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §2.2 Linear Equations in One Variable (perpendicular lines: the product of the slopes is −1; writing the equation of a line perpendicular to a given line through a point), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-2-linear-equations-in-one-variable (retrieved 2026-10-02); hand calculation in content.mdx: the altitude from C is x = 1; BC has slope −1/5, so the altitude from A has slope 5, y = 5x; H = (1, 5)"
    },
    {
      "given": {
        "ax": 0,
        "ay": 0,
        "bx": 5,
        "by": 0,
        "cx": 1,
        "cy": 3
      },
      "expect": {
        "orthocenter": "(1, 4/3)",
        "hy": 1.3333333333333333,
        "altA": "4x − 3y = 0"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §2.2 Linear Equations in One Variable (perpendicular lines: the product of the slopes is −1; writing the equation of a line perpendicular to a given line through a point), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-2-linear-equations-in-one-variable (retrieved 2026-10-02); hand calculation in content.mdx: x = 1; BC has slope −3/4, so the altitude from A has slope 4/3, y = 4x/3; H = (1, 4/3)"
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §2.2 Linear Equations in One Variable (perpendicular lines: the slope of one is the negative reciprocal of the other, m₁ · m₂ = −1; writing the equation of a line perpendicular to a given line through a point). https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-2-linear-equations-in-one-variable (retrieved 2026-10-02)",
    "Altitude (triangle), Wikipedia (the orthocenter is the point where the three, possibly extended, altitudes intersect; it lies inside an acute triangle and at the right-angle vertex of a right triangle). https://en.wikipedia.org/wiki/Altitude_(triangle) (retrieved 2026-10-02)"
  ],
  "related": [
    "triangle",
    "midpoint",
    "slope",
    "distance-formula"
  ],
  "changelog": []
}
