Add the lengths of all sides of the shape.
If the shape is a rectangle: use (P = 2(text{length} + text{width})).
If the shape is a square: use (P = 4 times text{side}).
If the shape is a triangle: use (P = a + b + c).
If the shape is a regular polygon: use (P = (text{number of sides}) times (text{side length})).
If the shape is a circle: use (P = 2pi r) or (P = pi d).
If the shape is irregular: add every outer edge length.
If sides are given indirectly (same-length sides): multiply by the number of equal sides, then add the remaining sides.
