SUBROUTINE TITLE : RAYN. 

 Siimmary of Subroutine : 



RA.rN calls SURFCE to obtain FK (ray curvature) for MAX = 1. MAX is then set 

 equal to two. RAYl^ calls MOVE in order that X^ Y, A^ and FK be obtained for 

 MAX = 2. ANGLE (equal to A but expressed in degrees instead of radians) and 

 PCTDIF are then computed. XXX and YYY are set equal to X and Y^ respectively, 

 so that significance is not lost when the values to be output are rounded. 

 ROUND is called for XXX, YYY, ANGLE, and PCTDIF before they are punched. MAX 

 is incremented by one, and the entire process continues until l) MAX = 500, 

 2) CDCY is equal to or less than zero, 3) MIT = 3, or h) NGO = 3. The first 

 condition guards against a ray going in an endless circle. The second pre- 

 vents a ray from leaving the water and going over land. The third prevents 

 invalid curvature approximations. The fourth condition stops a ray if it 

 reaches the edge of the grid. Any of these four conditions causes the 

 message, "RAY STOPPED" to be punched and transfers control back to MAIN. 

 If MIT = 2, the message "CURVATURE APPROXIMATED" is punched and computations 

 proceed as usual. 

 Remarks : 



The use of Sense Switch 3 keeps the operator informed of the cixrrent value 

 of MAX. 



SUBROUTINE TITLE : SURFCE. 

 Variables Used in Subroutine ; 



I,FI X + 1 roimded down to the nearest integer. 



J,FJ Y + 1 rounded down to the nearest integer. 



XL X + 1 - FI. 



YL Y + 1 - FJ. 



43 



