Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dioptric Harmonic Operator (DHO)

Micro-library for representing sphero-cylindrical refraction as a second-order angular harmonic.

Model

$$ P(\theta) = M + a\cos(2\theta) + b\sin(2\theta) $$

Why Second-Order

Refractive power over meridians is invariant under a 180 degree rotation of axis labeling. This symmetry implies periodicity in $\pi$, so the lowest nontrivial angular mode is $2\theta$, not $\theta$.

Assumptions

  1. Minus-cylinder convention.
  2. Axis is in degrees at the API boundary.
  3. $\theta$ is in radians by default for evaluation.

Prescription to Harmonic Coefficients

Let $\alpha$ be axis in radians.

$$ M = sph + \frac{cyl}{2} $$

$$ a = -\frac{cyl}{2}\cos(2\alpha) $$

$$ b = -\frac{cyl}{2}\sin(2\alpha) $$

Inverse conversion is implemented in the library with axis wrapped to $[0, 180)$ in degree form.

Relation to Other Fields

This representation is closely related to double-angle encodings used for axial orientation fields in computer vision and directional signal modeling.

Example

import numpy as np
from dho import DioptricOperator

op = DioptricOperator.from_sph_cyl_axis(-2.00, -1.50, 30.0)
print("coefficients (M, a, b):", op.coefficients())
print("reconstructed (SPH, CYL, AXIS):", op.to_sph_cyl_axis())

theta_deg = np.linspace(0.0, 180.0, 7)
print("P(theta):", op.evaluate(theta_deg, degrees=True))

op_rot = op.rotate(15.0, degrees=True)
print("rotated prescription:", op_rot.to_sph_cyl_axis())

Demo

A minimal GitHub Pages interface is provided in docs.

About

Second-order Fourier representation of refractive error as a directional dioptric operator with an interactive web app.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages