Chapter 24
Help Us Find These Missing Pieces
Riddler Express
The regular hexagon below has area 1. What is the area of the shaded region?

Solution
Put the hexagon at the origin with circumradius , so its area is and its vertices include the left vertex , the top-left vertex , and the centre . The drawn lines that bound the shaded piece are the horizontal axis , the vertical line through the top-left vertex, the diagonal from to the top-right vertex , and the diagonal from to the top-left vertex. Their crossings give the shaded quadrilateral Its area by the shoelace formula is , which as a fraction of the hexagon is Equivalently, the piece fills exactly one third of the upper-left equilateral triangle , which is itself one sixth of the hexagon.
The computation
Take the four corners in hexagon coordinates and apply the shoelace formula symbolically, then divide by the hexagon’s area.
import sympy as sp
s = sp.sqrt(3)
pts = [(sp.Rational(-1,2), 0), (sp.Rational(-1,2), s/6),
(sp.Rational(-1,4), s/4), (0, 0)]
area = abs(sum(pts[i][0]*pts[(i+1)%4][1] - pts[(i+1)%4][0]*pts[i][1]
for i in range(4))) / 2
print(sp.simplify(area / (3*s/2))) # 1/18
Riddler Classic
The large circle has radius 10, the medium circle radius 5, and the small orange circle radius 2. The orange circle crawls counterclockwise along the edge of the large circle until it meets the medium circle, then crawls up the edge of the medium circle to its crest. What is the area of the shaded orange region it sweeps out?

Solution
Center the large circle at the origin. The orange disk (radius ) keeps its center on the large circle and rides counterclockwise from the top down the left side to the bottom , a half turn. The medium circle, of radius , is tangent to the large circle at that bottom point, so its center is ; the orange disk transfers onto it and rides another half turn up to the crest .
As the center of a radius- disk travels a half circle of radius , the disk paints a half-annulus between radii and , of area . The two arcs contribute The path has two loose ends, at the very top of the large circle and at the crest of the medium circle, each rounded off by a semicircular cap of radius , together a full disk of area ; at the tangent point the disk passes through smoothly and the two half-annuli join without gap or overlap. The shaded area is therefore
The computation
Trace the swept region directly. Lay a fine grid over the plane and mark every point lying within distance of either arc of the center’s path; the marked area converges to .
import numpy as np
def near_arc(P, c, rho, a0, a1): # distance from points P to a circular arc
d = P - c; ang = np.arctan2(d[..., 1], d[..., 0]) % (2*np.pi)
lo, hi = a0 % (2*np.pi), a1 % (2*np.pi)
on = (ang >= lo) & (ang <= hi) if lo <= hi else (ang >= lo) | (ang <= hi)
radial = np.abs(np.hypot(d[..., 0], d[..., 1]) - rho)
ends = np.minimum(*[np.hypot(P[..., 0]-c[0]-rho*np.cos(a),
P[..., 1]-c[1]-rho*np.sin(a)) for a in (a0, a1)])
return np.where(on, radial, ends)
g = np.arange(-13, 13, 0.01); X, Y = np.meshgrid(g, g); P = np.stack([X, Y], -1)
d1 = near_arc(P, np.array([0., 0]), 10, np.pi/2, 3*np.pi/2) # big circle, half turn
d2 = near_arc(P, np.array([0., -5]), 5, 3*np.pi/2, 5*np.pi/2) # medium circle, half turn
covered = (d1 <= 2) | (d2 <= 2)
print(covered.sum() * 0.01**2, 64*np.pi) # ~201.06 = 64*pi