Computing: Free Pascal Programming

Ray tracing.

Download RayTrace desktop application (Windows 64bit) Download RayTrace source code (Lazarus/Free Pascal)

Description: Physics (geometrical optics) application, that may be used to trace rays falling on concave/convex mirrors and thin bi-convex/bi-concave lenses. The application determines all relevant data (describing the optical device and the image formed, calculating focal length, image height and distance, lens strength and magnification) as well as draws a graphical display of the P-, F- and C-ray passing through the system studied.

Improvement: Adapting the in-going ray length depending on its vertical position (i.e. depending on the mirror/lens shape at this position) in order to get nicer drawings.

Possible extensions: Adding flat mirrors and planar-convex/planar-concave lenses.

Free Pascal features: Bitmap canvas graphics; drawing arcs and ellipses. Using line equation and line intersection calculations to draw lines passing through 2 given points. Adding arrow-heads to a line.


Ray tracing PC application: Mirror case 2 image formation
Ray tracing PC application: Lens case 1 image formation