Calculates a shape's area and perimeter.