Mathematics of doodling and the winding number

This problem is one of the easiest applications of Frenet formulas for planar curves and can be found in differential geometry textbooks.

Some minor corrections: First, $q$ is usually called "turning number" rather than "winding number". (The winding number is how many times a curve goes around a marked point; the turning number is how many times its velocity vector goes around the origin.) The turning number equals the integral of the curvature divided by $2\pi$. Second, as others noticed, $r$ should not be too large if the curvature attains negative values. More precisely, the result holds true for $r<1/\max(-\kappa)$ where $\kappa$ denotes the curvature.

The proof goes as follows. Let $t\mapsto s(t)$ be an arc-length parametrization of the original curve and $V(t),N(t)$ its Frenet frame. Then the $r$-shifted curve is parametrized by $$ s_r(t) = s(t) - rN(t) . $$ Then the velocity of $s_r$ is given by $$ s_r'(t) = V(t) + r\kappa(t)V(t) = (1+r\kappa(t)) V(t) $$ because $s'=V$ and $N'=-\kappa V$ by Frenet formulas. Then $$ Length(s_r) = \int |s_r'| = \int |1+r\kappa| = \int (1+r\kappa) = Length(s) + r\int\kappa = Length(s) + 2\pi q r . $$ The area formula is obtained from the length one by integration.


I think it is fairly straightforward in the polygonal case, and I'd wager that the general case follows from the polygonal case.

Let $c(t)$ be a polygonal curve whose maximal winding number is $q$, and assume it has winding number $q$ around the origin. As you move along a line segment in $c$, you will trace out another line segment of exactly the same length. When you hit a corner, you will rotate in place until you are facing in the direction of the next line segment, and so you will trace out a circular arc of radius $r$ whose angle agrees with the angle of the curve at that corner. The "polygonal Gauss-Bonnet theorem" asserts that the winding number of a polygonal curve is $\frac{1}{2\pi}$ times the sum of the angles (with the right orientation).

So to compute the perimeter of the doodle, notice that the line segments in the doodle have total length $Perim(c)$ since each segment in the doodle corresponds to one in $c$ of the same length. At each corner we get a contribution corresponding to the angle at that corner times $r$, for a total contribution of $2\pi r q$. Area can be computed in a similar way: movement along line segments adds $r$ times the length of the line segment to the area for a total contribution of $r Perim(c)$, and the corners yield a total contribution of $\pi r^2 q$.