Skip to main content

refract

Function refract 

Source
pub fn refract(
    incident: &Vector3D,
    normal: &Vector3D,
    eta: f64,
) -> Option<Vector3D>
Expand description

Computes the refraction of a vector through a surface.

Uses Snell’s law with eta = n1/n2 (ratio of refractive indices). Returns None for total internal reflection.