# Square Pyramid Calculator

> Computes the volume, slant height, lateral edge, base area, lateral and total surface area and face slope in degrees of a right square pyramid from its base side and height.

- Calculator id: `pyramid` · Category: Geometry (`geometry`) · Tool name: `calculate_square_pyramid_properties`
- Canonical page: https://tttkmbb.com/geometry/pyramid · This document: https://tttkmbb.com/geometry/pyramid.md · JSON definition: https://tttkmbb.com/geometry/pyramid.json

## Purpose

Computes the volume, slant height, lateral edge, base area, lateral and total surface area and face slope in degrees of a right square pyramid from its base side and height.

**Use when:** You need the volume or surface of a pyramid with a square base and the apex above the centre of the base.

**Do not use when:** The base is a circle (use cone), a non-square rectangle or triangle, or the apex is off-centre (oblique pyramid).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `base_side` | number | units | required | Length of one side of the square base. (> 0) |
| `height` | number | units | required | Perpendicular distance from the base to the apex. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `volume` | number | units³ | base_side² × height / 3. |
| `slant_height` | number | units | √(height² + (base_side / 2)²), height of each triangular face. |
| `lateral_edge` | number | units | √(height² + base_side² / 2), length of each edge from a base corner to the apex. |
| `base_area` | number | units² | base_side². |
| `lateral_area` | number | units² | 2 × base_side × slant_height (four triangular faces). |
| `total_surface_area` | number | units² | base_side² + 2 × base_side × slant_height. |
| `face_slope_deg` | number | degrees | Angle between a triangular face and the base = atan(height / (base_side / 2)). |

## Formula

`volume = base_side² · height / 3; slant_height = √(height² + (base_side/2)²); lateral_edge = √(height² + base_side²/2); lateral_area = 2 · base_side · slant_height; total_surface_area = base_side² + lateral_area; face_slope_deg = atan(2 · height / base_side)`

## Data Sources

- Wikipedia – Square pyramid — https://en.wikipedia.org/wiki/Square_pyramid (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Square Pyramid — https://mathworld.wolfram.com/SquarePyramid.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pyramid?base_side=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/pyramid` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pyramid · OpenAPI operationId `calculate_square_pyramid_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pyramid", "inputs": {…}}`

## Example

- Base 6, height 4: inputs `{"base_side":6,"height":4}` → `{"volume":48,"slant_height":5,"lateral_edge":5.831,"base_area":36,"lateral_area":60,"total_surface_area":96,"face_slope_deg":53.1301}`
- Great Pyramid of Giza (230.4 m base, 146.6 m original height): inputs `{"base_side":230.4,"height":146.6}` → `{"volume":2594046,"slant_height":186.4473,"lateral_area":85914.92,"face_slope_deg":51.8393}`

```
GET https://tttkmbb.com/api/v1/calculate/pyramid?base_side=6&height=4
```

## Limitations

The base is a circle (use cone), a non-square rectangle or triangle, or the apex is off-centre (oblique pyramid). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Slant height or lateral edge?**

The slant height runs from the apex to the midpoint of a base side (the height of a face); the lateral edge runs from the apex to a base corner and is longer.

**What about a rectangular base?**

Volume is length × width × height / 3, but the two pairs of faces have different slant heights; this calculator only handles square bases.

## Related

- [Cone Calculator](https://tttkmbb.com/geometry/cone.md) — Circular-based counterpart with the same volume formula (base area × height / 3).
- [Rectangular Prism Calculator](https://tttkmbb.com/geometry/rectangular-prism.md) — A prism with the same base and height has three times the volume.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Slant height and lateral edge come from right triangles with the height as one leg.
