Calculates the refraction vector of two vectors.
// Returns a refracted vector when light passes from air to waterconst refracted = Chalkboard.vect.refract(Chalkboard.vect.init(0, -1), Chalkboard.vect.init(0, 1), 1.33); Copy
// Returns a refracted vector when light passes from air to waterconst refracted = Chalkboard.vect.refract(Chalkboard.vect.init(0, -1), Chalkboard.vect.init(0, 1), 1.33);
The first vector (the incident vector)
The second vector (the normal vector)
The refractive index of the refractive medium
Calculates the refraction vector of two vectors.
Example