Calculates the period of a simple pendulum as T = 2π√(length ÷ gravity), valid for small swings and independent of the mass. Length is in metres and the period in seconds.
Hang a weight on a string, set it swinging, and the time it takes to go out and come back is the period. For small swings it depends on only two things.
Notice what is missing: the mass. A heavy bob and a light one on strings of equal length keep exactly the same time. The amplitude is missing too, as long as the swings stay small. That property, isochronism, is why pendulums ended up inside clocks.
The defaults are a length of 1 m and gravity of 9.8 m/s².
The period is about 2.0071 s. A full swing takes almost exactly two seconds, so a one-metre pendulum crosses from side to side about once a second.
The formula is an approximation that holds for small swings, up to a few degrees. Wider swings take a little longer: at an amplitude of 30 degrees the true period is about 1.7 % greater than this.
It also assumes the string is light enough to ignore and the bob small enough to treat as a point.
The period follows the square root of the length, so a pendulum four times as long swings half as often.
Length and gravity must both be greater than zero. Zero or a negative value gives an error.