lens_maker_kernel

Function lens_maker_kernel 

Source
pub fn lens_maker_kernel(
    n: IndexOfRefraction,
    r1: f64,
    r2: f64,
) -> Result<OpticalPower, PhysicsError>
Expand description

Calculates optical power and focal length using the Lens Maker’s Equation.

$$ P = (n - 1) \left( \frac{1}{R_1} - \frac{1}{R_2} \right) $$

Uses the sign convention where:

  • Light travels from left to right.
  • Radius of curvature $R$ is positive if the center of curvature is to the right of the surface.
  • Therefore, for a biconvex lens, $R_1 > 0$ (front surface convex) and $R_2 < 0$ (back surface convex).

§Arguments

  • n - Refractive index of the lens material (assuming ambient index is 1).
  • r1 - Radius of curvature of the first surface.
  • r2 - Radius of curvature of the second surface.

§Returns

  • Result<OpticalPower, PhysicsError> - Optical power in Diopters.