Calculations in 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).