"""Lab to Code — 2026 Nobel Prize in Physics (IceCube): the Cherenkov cone in ice.

A charged particle moving faster than light does in ice emits light in a cone: cos(theta) = 1 / (n * beta).
"""
from math import acos, degrees

C = 299_792_458.0      # speed of light in vacuum, m/s
N_ICE = 1.31           # refractive index of glacial ice


def cherenkov_deg(n, beta=1.0):
    """Angle of the Cherenkov cone, in degrees."""
    return degrees(acos(1.0 / (n * beta)))


v = C / N_ICE
print(f"Cherenkov cone in ice: {cherenkov_deg(N_ICE):.1f} deg")
print(f"light speed in ice: {v / 1e6:.1f} km/ms")
print(f"time to cross 100 m: {100.0 / v * 1e9:.0f} ns")
