# Confused on reflection coeffcient of Fresnel equations

I am reading a paper about layered materials. However, I am confused on the implementation of this paper. The following picture describe the layered material.

r_ab is a complex reflection coeffcient when going from medium a to medium b.

And in the code, there is:

        float2 R12, phi12;
fresnelDielectric(LdotH, 1.0, eta_2, R12, phi12);
float2 R21 = R12;


I don't understand why is r_12 equal to r_21?

We have $$t_{12} = t_{21}$$, by the law of reciprocity. Also, $$r_{12} + t_{12} = 1\\r_{21} + t_{21} = 1$$ It follows that $$r_{12} = r_{21}$$ as well.
• @TIANLUNZHU It's because of the law of reciprocity, a fundamental principle of optics. It says if you swap the incoming and outgoing rays, the BSDF (reflectance or transmittance) doesn't change. Note from the diagram that the $t_{12}$ and $t_{21}$ cases are exactly symmetrical with each other, only with the rays going in the opposite directions. – Nathan Reed Jan 21 at 5:38