Area formulas for 2D shapes
Every formula below takes lengths in one consistent unit and returns an area in that unit squared. Heights are perpendicular heights, measured at a right angle to the base, not slanted side lengths.
| Shape | Inputs | Area formula |
|---|---|---|
| Rectangle | Length, Width | A = length × width |
| Square | Side | A = side² |
| Triangle — base and height | Base, Perpendicular height | A = base × height ÷ 2 |
| Triangle — three sides | Side a, Side b, Side c | s = (a + b + c)/2; A = √(s(s−a)(s−b)(s−c)) |
| Circle | Radius | A = πr² |
| Ellipse | Semi-major axis, Semi-minor axis | A = πab |
| Trapezoid | Parallel side a, Parallel side b, Perpendicular height | A = (a + b)h ÷ 2 |
| Parallelogram | Base, Perpendicular height | A = base × height |
| Parallelogram — two sides and angle | Side a, Side b, Angle between sides in degrees | A = ab·sin θ; diagonals p, q = √(a² + b² ± 2ab·cos θ) |
| Trapezoid — four sides | Longer base a, Shorter base b, Leg c, Leg d | h from the triangle with sides c, d and a − b (Heron); A = (a + b)h ÷ 2 |
| Rhombus | Diagonal 1, Diagonal 2 | A = d₁d₂ ÷ 2 |
| Circular sector | Radius, Angle in degrees | A = πr² × angle/360 |
| Regular polygon | Number of sides, Side length | A = ns² ÷ (4 tan(π/n)) |
| Stadium (rectangle with semicircle ends) | End radius, Straight side length | A = πr² + 2ra; P = 2πr + 2a |
| Annulus (ring) | Outer radius, Inner radius | A = π(R² − r²) |
Perimeter and circumference
Perimeter is the total length around a shape. For a circle it is called the circumference.
| Shape | Perimeter formula | Variables |
|---|---|---|
| Square | P = 4s | s = side |
| Rectangle | P = 2(l + w) | l = length, w = width |
| Triangle | P = a + b + c | a, b, c = sides |
| Circle | C = 2πr = πd | r = radius, d = diameter |
| Circular sector | P = 2r + πrθ/180 | θ = central angle in degrees |
| Regular polygon | P = ns | n = number of sides, s = side |
| Parallelogram | P = 2(a + b) | a, b = adjacent sides |
| Rhombus | P = 4s = 2√(d₁² + d₂²) | d₁, d₂ = diagonals |
| Ellipse (approximation) | P ≈ π(a + b)(1 + 3h/(10 + √(4 − 3h))), h = (a − b)²/(a + b)² | Ramanujan's approximation; the exact value needs an elliptic integral |
Angles and triangles
The interior angles of any triangle add up to 180°, and those of an n-sided polygon add up to (n − 2) × 180°. Each interior angle of a regular polygon is (n − 2) × 180° ÷ n.
For a right triangle with legs a and b and hypotenuse c, the Pythagorean theorem gives a² + b² = c². Heron's formula finds the area of any triangle from its three sides: A = √(s(s − a)(s − b)(s − c)) with s = (a + b + c)/2.