@echo off
echo       (C) Gleb Vdovin 1993-1995
echo       This file is a part of LightPipes beta distribution
rem       
rem       

begin 15. 3e-4 256 > field1

rem       40 iterations inside the resonator


rem First iteration:

rem       reflection from the convex mirror and propagation 
	
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
rem       reflection from the concave mirror and propagation
	
	rect_ap 10.96 < field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1
	convert Y < field1 | Strehl y > null
	rect_ap 5.48 < field1 | lens_forvard -1e4  1e4 > field2
	rect_ap 10.96 <field2 | lens_forvard 2e4  1e4 | normal y > field1
	interpol 15. < field1 > field2 
	move field2 field1

    
rem output of the resonator is screened by the output mirror:
rem the output 
convert y < field1 | rect_screen 5.48 | file_int in > foo 
file_pha pha < foo | file_ps res_out.ps | Strehl y > null
rem removing the temp files
 del field1 
 del field2
 del foo


