Mathematical formula of Vector Refraction?

The current node does return a value in such cases nonetheless

Yeah I just calculated the situation where θ₁ of Snell’s Law > 90°, and the formula actually does output a refracted vector, and Blender’s result is the same as the formula’s output, but the refracted vector’s direction makes it look nothing like a refraction.


This is my calculation and Blender’s displacement:

success5


One question: Does Total Internal Reflection exist in Blender?
I’m told that, in order for Total Internal Reflection to occur, the Square root of OpenGL’s formula
t = μ[i−(ni)n]− √(1−μ²[1−(ni)²]) n
has to be negative, hence there’ll be Imaginary number.
But if that’s true, how does the formula even output a (Real valued) vector in that situation since there’s an Imaginary number inside it?
Does Blender even work with Imaginary number?