Volumes of cones and pyramids