n₁ sin θ₁ = n₂ sin θ₂. Drag the interface or incoming ray. Watch for total internal reflection when n₁ > n₂.