Capsule Calculus