Mechanics of polarization ray tracing