Understanding the perimeter calculator — concept and principle
This calculator finds the perimeter, the total distance around a flat shape, for triangles, rectangles, squares, parallelograms, trapezoids, kites, regular polygons, circles, semicircles, sectors and ellipses. Use it for fencing, edging, trim, skirting boards, frames and geometry homework.
How it is calculated
- Triangle: a + b + c. Right triangle: a + b + √(a² + b²).
- Rectangle, parallelogram and kite: 2(a + b). Square: 4a.
- Any quadrilateral: a + b + c + d. Isosceles trapezoid: a + b + 2√(((a − b)/2)² + c²).
- Regular polygon: n × a.
- Circle: 2πr. Semicircle: πr + 2r. Sector: 2r + πr·θ/180.
- Ellipse: Ramanujan's approximation π(a + b)(1 + 3h/(10 + √(4 − 3h))), h = ((a − b)/(a + b))².
The result is in the same unit as the lengths you enter. "Missing side or arc" shows any length the formula worked out for you.
The principle
For a polygon the perimeter is simply the sum of the side lengths. Shapes with equal sides let you multiply instead of add. When a side is not given directly, the Pythagorean theorem finds it, as with a right triangle's hypotenuse or the slanted side of an isosceles trapezoid. For curves, the circumference of a circle is π times its diameter by definition of π, and a sector's arc is the fraction θ/360 of that circumference. An ellipse has no simple exact formula, so Ramanujan's approximation is used; it is extremely accurate for everyday shapes.
Worked example
Default inputs: rectangle, length a = 8, width b = 5.
- Formula: P = 2(a + b).
- a + b = 8 + 5 = 13.
- P = 2 × 13 = 26.
- The semi-perimeter is 26 ÷ 2 = 13. No missing side is needed for a rectangle.
| a | Perimeter |
|---|---|
| 2 | 14 |
| 4 | 18 |
| 6 | 22 |
| 8 | 26 |
| 10 | 30 |
| 12 | 34 |
| 16 | 42 |
How to read the result
The perimeter is a length, so it has the same unit as the sides: metres in, metres out. For fencing or trim, add a margin for waste, overlaps and gates. Perimeter and area measure different things: two rectangles with the same perimeter can have very different areas, and a square has the largest area of all rectangles with a given perimeter.
Common mistakes
- Adding only two sides of a rectangle instead of all four.
- Confusing radius and diameter in circle formulas.
- Forgetting the straight edges of a semicircle or sector.
- Mixing units, such as metres and centimetres.
- Entering three triangle sides that cannot form a triangle.
Frequently asked questions
What is the difference between perimeter and circumference?
Circumference is the perimeter of a circle; perimeter is the general term for any shape.
How do I find the perimeter of an L-shaped room?
Add the lengths of all outer walls, or split it into rectangles and remove the shared edges.
Is the ellipse perimeter exact?
It uses Ramanujan's second approximation, which is accurate enough for practical work.
Sources: OpenStax, Prealgebra 2e, §9.3–9.5 · S. Ramanujan, "Modular equations and approximations to π" (1914)