I'm challenging my optical design skills by coding a ray-tracing Python script. I know that many good packages exist out there, but I'm trying not to skips steps by building everything on my own.
For simplification purposes, the inputs of the script are :
- pupil specification : entrance pupil diameter or object numerical aperture
- field specification : field angle or object height
- shape and position of the surfaces (including the stop)
In order to compute the direction cosine of the rays at the object point and start tracing, we need to know the location and diameter of the entrance pupil. The entrance pupil's location is, for a given object point, where the chief ray crosses the optical axis as seen from the object.
How can I translate this in Python in order to compute the direction cosine at the object point?