Square pyramid (source code)

= Square pyramid
{title2=$V=a^2h/3$}

A square pyramid has a square base. If the base edge has length $a$ and all four lateral edges have length $\ell>a/\sqrt2$, the apex lies above the base center. The center-to-vertex distance is $a/\sqrt2$, so the <Pythagorean theorem> gives $h=\sqrt{\ell^2-a^2/2}$. Its <volume> is $a^2h/3$. When all eight edges have the same length $a$, this reduces to $a^3/(3\sqrt2)$.