System4f.opticalInvariant
- raytracing.System4f.opticalInvariant(self, ray1, ray2, z=0)
The optical invariant is a quantity that is conserved for any two rays in the system. It is very general and any two rays can be used. At a given position z, it is simply n✕(θ₁y₂ - θ₂y₁), where n is the index at that z.
In an ImagingPath, it will often be calculated with the principal and axial rays, in which case the optical invariant is called the Lagrange Invariant. The Lagrange invariant is the maximal optical invariant that guarantees neither rays will be blocked.
- Parameters:
ray1 (object of Ray class) – A ray at height y1 and angle theta1 (default=None)
ray2 (object of Ray class) – A ray at height y2 and angle theta2 (default=None)
z (float) – A distance that shows propagation length (default=0)
- Returns:
opticalInvariant – The value of the optical invariant constant for ray1 and ray2
- Return type:
float
Examples
Since there is no input for the function, the optical invariant value is calculated for chief and marginal rays.
>>> from raytracing import * >>> path = ImagingPath() # define an imaging path >>> # use append() to add elements to the imaging path >>> path.append(Space(d=10)) >>> path.append(Lens(f=10,diameter=10,label="f=10")) >>> path.append(Space(d=30)) >>> path.append(Lens(f=20,diameter=15,label="f=20")) >>> path.append(Space(d=20)) >>> ray1, ray2 = Ray(0.5,0.05) , Ray(3,0.25) >>> print('optical invariant :', path.opticalInvariant(ray1,ray2)) optical invariant : 0.025000000000000022
Notes
This quantity is L = n (y1 theta2 - y2 theta1)