> PRISM REFRACTION CIPHER
The idea in plain English: A laser fires horizontally into a triangular prism made of a material like glass or acrylic. When the beam enters the prism, it bends — that's refraction. When it exits, it bends again. Where the beam lands on the far wall depends on three things: where you fire the laser (its vertical position), how the prism is rotated, and what the prism is made of (its refractive index). Adjust any one and the beam hits a different spot on the wall, which maps to a different character.
Why this really exists: Snell's Law (Willebrord Snellius, 1621) describes exactly how light bends when passing between materials. n₁ sin(θ₁) = n₂ sin(θ₂), where n is the refractive index and θ is the angle from the normal. It's the physics behind lenses, fiber optics, prisms, rainbows, and eyeglasses. Every time you put on glasses, you're trusting Snell's Law to bend light onto your retina at exactly the right angle.
▸ Concrete Example
A laser at position y=0.3 fires into a glass prism (n=1.52) rotated 15°:
2. Inside the prism: n_air × sin(θ₁) = n_glass × sin(θ₂)
3. → sin(θ₂) = sin(θ₁) / 1.52
4. The beam travels through the prism to the second face
5. It exits: n_glass × sin(θ₃) = n_air × sin(θ₄)
6. The exit angle θ₄ determines where it hits the wall
The wall position maps to a character — usually the letters A-Z printed on the inner wall of a ring around the prism.
The cipher is nonlinear: doubling the laser position doesn't double the wall coordinate. You must simulate the full ray trace — geometry plus Snell's Law — to find which character the beam lands on.
▸ How to Decode (Step by Step)
1. The laser position is given as a Y coordinate on the left wall
2. Calculate where the laser hits the first face of the prism using geometry
3. Compute the incident angle θ₁ relative to the face normal
4. Apply Snell's Law: θ₂ = arcsin(sin(θ₁) / n) where n = n_glass / n_air
5. Trace the beam through the prism to the second face
6. Apply Snell's Law again at the exit face
7. Compute the exit angle θ₄ and intersect it with the far wall
8. The Y coordinate on the far wall maps to a character via a lookup table
n_ratio = n_glass / n_air
hit = intersect_ray_with_prism_face(laser_pos, prism_rotation)
θ₁ = angle_between(ray_direction, face_normal)
θ₂ = arcsin(sin(θ₁) / n_ratio)
internal_ray = refract(ray_direction, face_normal, θ₂)
hit2 = intersect_ray_with_prism_face(internal_ray, second_face)
θ₃ = angle_between(internal_ray, second_face_normal)
θ₄ = arcsin(n_ratio * sin(θ₃))
exit_ray = refract(internal_ray, second_face_normal, θ₄)
wall_y = intersect_ray_with_wall(exit_ray)
letter = character_map[wall_y]
▸ Real-World Applications
- Fiber optics: Light travels through a glass fiber by total internal reflection — Snell's Law prevents it from escaping
- Lenses: Every camera, microscope, telescope, and eyeglass lens refracts light according to Snell's Law
- Rainbows: Water droplets act as millions of tiny prisms, splitting sunlight into its component colors
- Spectroscopy: Prisms disperse light by wavelength, letting scientists identify materials from their spectral fingerprint
- Atmospheric refraction: Stars appear slightly above their true position because light bends through the atmosphere — same physics, larger scale