# How Lighthouses Work 1, Exercise 1: the inverse square law # A light of 250,000 candela (an assumed, illustrative figure). Find the # illuminance it gives at 1, 2, 3 and 5 km, the distance at which it has fallen # to 0.01 lx, and the intensity needed to give the same 0.01 lx at twice that # distance. import math I = 250_000 # assumed intensity, candela (illustrative) def lux(i, d_m): return i / d_m ** 2 for km in (1, 2, 3, 5): print(f"{km} km", round(lux(I, km * 1000), 4)) # distance at which the light has fallen to 0.01 lx d = math.sqrt(I / 0.01) print(round(d), "m") # intensity needed to give the same 0.01 lx at twice that distance needed = 0.01 * (2 * d) ** 2 print(round(needed), round(needed / I, 1)) # Output when run: # 1 km 0.25 # 2 km 0.0625 # 3 km 0.0278 # 5 km 0.01 # 5000 m # 1000000 4.0 # # Reading the output: 1 km gives 0.25 lx, and doubling to 2 km gives 0.0625 lx, # a quarter. At 5 km the light has fallen to exactly 0.01 lx (5,000 m). To get # the same 0.01 lx at 10 km the light would need 1,000,000 cd, which is 4.0 # times the intensity: doubling a distance costs four times the intensity. # Note this ignores the haze in the air, which Allard's law (in the chapter) # adds.