since the optical medium has an index of refraction n>1, and air has an index of refraction n˜1, the optical medium is denser than air.
by snell's law, sin i1 / sin r1 = sin r2 / sin i2
hence, i1 = r2
and r1 = i2
based on the diagram as shown,
x = r2 - i2
= i1 - r1
--------------------------------------------------
cos i2 = e / y
y = e / cos i2
---------------------------------------------------
sin x = d/y
d = y sin x
= e sin ( x) / cos i1
= e sin (i1 - r1) / cos r1 (proven)