Capsule

Calculate a capsule with a cylindrical middle of length h and two hemispherical ends. The cylindrical-section length may be zero.

Inputs

Formula
V = πr²h+4πr³/3; S = 2πrh+4πr²
  • r — capsule radius
  • h — length of the cylindrical section (h ≥ 0)