Calculations at a gear, or cogwheel, with isosceles trapezoids as cogs. Those are set regularly on a circle, so that the cog edge exactly fits in the gap between the cogs. This is a simplified representation of a gear, it is not checked whether the gear works or not. For a gear with pointed cogs, see polygram.
The required input is: for the number of cogs a natural number of at least 3. Two values of circle radius, cog height and gear radius. The ratio between cog edge (or gap) and cog base. For this, v ∈ ] 0 ; 1 ] must apply. The other values will be calculated.

Formulas:
R = r + i
a = 2 * π * r / [ n * ( 1 + 1/v ) ]
b = a / v
h = r * { 1 - cos[b/(2r)] } + i
c = √ h² + (a-b)² / 4
s = 2 * √ 2 * r * (h-i) - (h-i)²
p = 2n * (a + c)
A = π * r² + n/2 * [ √ ( a + b )² * ( a - b + 2c ) * ( b - a + 2c ) / 2 - r * b + s * ( r - h + i ) ]

Test, if c intersects the circle:
if b/(2r) > arccos{ [ (s-a)²/4 + c² - h² ] / [ (s-a) * c ] }
the cog is too flat.

pi:
π = 3.141592653589793...

Radiuses, heights, lengths and perimeter have the same unit (e.g. meter), the area has this unit squared (e.g. square meter).

This is one possible shape of a gear - and one that can be easily calculated. This serves primarily as an example for finding formulas and calculating such forms. In modern gears, the teeth often have rounded shapes so that they roll better, but this makes such calculations extremely difficult. Old gears sometimes used rectangular shapes, which risked them becoming wedged easily. Rectangular teeth can be calculated here with the ratio v=1.
Gears are not a modern invention; they were used in ancient Egypt and Greece. The Antikythera mechanism from the first century BC is famous and was probably a type of astronomical clock. Due to industrialization, especially the steam engine, gears then became a mass product for the transmission of power. Today they can be found in all kinds of mechanical devices, very small ones in wristwatches and very large ones, for example in the drive system of cable cars.