I do ray tracing and I do ray refraction using the following relation (I got it from a PDF called Reflexes and Refractions in Ray Tracing):


But I saw this in another PDF as follows: 
Could you explain to me why?
And how can I assure that my refractive vector, which I calculated, is correct?
thanks
source share