geoptics-thin-lens
v0.9.4
Published
Thin-lens geometric optics: image distance, magnification, lensmaker's equation and optical power.
Maintainers
Readme
geoptics-thin-lens
Gaussian thin-lens optics in a few lines of CommonJS. No dependencies.
Handles the ideal thin-lens model: a single lens with negligible thickness, paraxial rays. That covers the vast majority of intro-optics problems and quick imaging estimates. Thick lenses, aberrations and ray tracing are out of scope.
Sign convention
Cartesian, as used in most introductory texts:
- object distance
dopositive for a real object, - image distance
dipositive → real image on the far side, - converging lens has
f > 0, divergingf < 0, - magnification
mnegative → inverted image.
Usage
const optics = require('geoptics-thin-lens');
const di = optics.imageDistance(10, 15); // 30
const m = optics.magnification(15, di); // -2 (inverted, 2x)
optics.isReal(di); // trueLensmaker's equation for a lens in air:
// n = 1.5, biconvex, R1 = +0.1 m, R2 = -0.1 m
optics.lensmaker(1.5, 0.1, -0.1); // f = 0.1 m
optics.powerDioptres(0.1); // 10 DFunctions
imageDistance(f, do)magnification(do, di)imageHeight(ho, m)combinedFocalLength(f1, f2)— two thin lenses in contactlensmaker(n, R1, R2)powerDioptres(fMetres)isReal(di)
License
ISC
