結果

Pyramid and Prism Volumes

Plain English first

Prism: Any shape with a uniform cross-section from bottom to top. Take the area of that cross-section, multiply by the height. That's the volume — just stacking identical layers.

Pyramid: A shape that tapers from a base to a point. Three pyramids with the same base and height always fill one prism. So the volume is always ⅓ × (base area) × height. Same ⅓ logic as cones.

The connection: cones are circular pyramids. Cylinders are circular prisms. The ⅓ relationship holds for any pyramid/prism pair, regardless of the shape of the base.


Standard math notation

Right Prism:
  V = B × h
  where B = area of the base (any shape)
        h = height

Total surface area:
  T = 2B + P × h
  where P = perimeter of the base

Pyramid:
  V = ⅓ × B × h
  where B = area of the base
        h = perpendicular height to apex

Total surface area:
  T = B + ½ × P × ℓ
  where ℓ = slant height (from base edge midpoint to apex)

Verbose Python with descriptive names

def compute_prism_volume(
    area_of_base_cross_section,
    height_of_prism
):
    """
    A prism is a shape with a uniform cross-section extruded upward.
    Volume = area of one cross-section × number of cross-section layers stacked.
    Works for rectangular, triangular, hexagonal, or any prism.
    """
    volume = area_of_base_cross_section * height_of_prism
    return volume

def compute_pyramid_volume(
    area_of_base,
    perpendicular_height_to_apex
):
    """
    Three pyramids with matching base and height fill one prism exactly.
    So a pyramid is always one third of its surrounding prism.
    Works for square pyramids, triangular pyramids (tetrahedra), any base.
    """
    volume_of_matching_prism = area_of_base * perpendicular_height_to_apex
    volume_of_pyramid        = volume_of_matching_prism / 3
    return volume_of_pyramid

def compute_prism_surface_area(
    area_of_base,
    perimeter_of_base,
    height_of_prism
):
    area_of_both_bases = 2 * area_of_base
    area_of_side_walls = perimeter_of_base * height_of_prism
    return area_of_both_bases + area_of_side_walls

def compute_pyramid_surface_area(
    area_of_base,
    perimeter_of_base,
    slant_height_from_base_edge_to_apex
):
    area_of_lateral_faces = 0.5 * perimeter_of_base * slant_height_from_base_edge_to_apex
    return area_of_base + area_of_lateral_faces

# Triangular prism (cross-section is a right triangle: base=3, height=4)
triangle_area = 0.5 * 3 * 4   # = 6
prism_vol = compute_prism_volume(
    area_of_base_cross_section=triangle_area,
    height_of_prism=10
)
print(f"Triangular prism volume: {prism_vol}")   # 60.0

# Square pyramid (base 4×4, height 6)
square_base_area = 4 * 4   # = 16
pyramid_vol = compute_pyramid_volume(
    area_of_base=square_base_area,
    perpendicular_height_to_apex=6
)
print(f"Square pyramid volume: {pyramid_vol}")   # 32.0

The ⅓ pattern across all tapering shapes

Shape Base Formula
Rectangular prism Rectangle V = lwh
Triangular prism Triangle V = ½bh × depth
Cylinder Circle V = πr²h
Pyramid Any polygon V = ⅓Bh
Cone Circle V = ⅓πr²h

Prisms and cylinders stack identical layers → full base × height. Pyramids and cones taper to a point → ⅓ of the surrounding prism/cylinder.


Builds on

See also

コメント

まだコメントはありません。最初のコメントを!


コメントはモデレートされ、承認後に表示されます。