40th example file, to illustrate the scattering option.

This is available only in the 'special' scattering version of CPO2D or CPO2DS.

The geometry is that of the 3rd benchmark test. The rays start at z = -0.5, in a field-free region.  When the rays reach z = 0 they are focused by a thin lens.

The routine that defines the scattering function is compiled in 'scatter2.dll'.  This routine calls a data file which is named by the User in the databuilder. In the present example the name is 'scatter2.dat'. This can be copied from the file sct2lens.dat that is supplied with the CPO2D package and that is:

 0.   =zc, plane of lens

 1.   =fl, focal length

 0.   =cs, spherical aberration coefficient

(but the comments are removed before use)

The routine below is called sct2lens.cpp.  It should be copied to scatter2.cpp and then built into scatter2.dll  (a direct-linked-library routine) by following the instructions given in Help.

Please refer to sct2lens.cpp for further details.