---
tag: 0X89GC65N1
kind: definition
name: Altitude of a triangle
msc: [51M04]
defines: 0C9MZY2RNA
uses: [0CTNFGYMM2, 0MP9BCF6DP, 0JW13B48YP, 01AAYNSBN6]
sources:
  - url: https://en.wikipedia.org/wiki/Altitude_(triangle)
    locator: lead section
---

## Definition

Let $ABC$ be a [[triangle|0CTNFGYMM2]] in the Euclidean space $\mathbb{R}^n$, and let $\cdot$ be the dot product. Let $H_A$ be the orthogonal projection of $A$ onto the [[line|0MP9BCF6DP]] $BC$:
$$H_A = B + \frac{(A - B) \cdot (C - B)}{(C - B) \cdot (C - B)} \, (C - B).$$
The altitude of $ABC$ from $A$ is the segment from $A$ to $H_A$. The point $H_A$ is the foot of the altitude, and $h_a = \|A - H_A\|$ is its length.
The altitudes from $B$ and from $C$ are defined in the same way.

## Remarks

The formula uses the [[vector projection|0JW13B48YP]] of $A - B$ onto $C - B$. The length $h_a$ is the [[distance from $A$ to the line $BC$|01AAYNSBN6]].
The word altitude also names the whole line through $A$ and $H_A$, or the length $h_a$. Mathlib's `Affine.Simplex.altitude` is the line.
With $a = \|C - B\|$, the area of the triangle is $\frac{1}{2} a h_a$.
Let the right angle of a right triangle be at $C$. Then the leg $AC$ is the altitude from $A$, and the leg $BC$ is the altitude from $B$.

## Explanations

### L1 human

An altitude is the height of a triangle, measured from one corner. Drop a plumb line from the corner to the opposite side, or to its extension. The foot of the altitude can be outside the triangle when the triangle has an obtuse angle.
