// PhotonPath.java // This class calculates and stores a photons path through a cloud using // a given cloud and scattering model. import java.util.*; public class PhotonPath { public PhotonPath(Cloud c,ScatteringModel s,RTVector mu) { in_dir=new RTVector(mu); current_dir=in_dir; current_r=c.RandomStartLocation(in_dir); path=new Vector(20,10); cloud=c; sm=s; path.addElement(current_r); } // You can call the Follow function to have the photon followed for a certain // number of steps. When it returns true then the photon has left the cloud and // there is no point calling Follow any more so create another PhotonPath and do // another one. public boolean Follow(int max_steps) { int step; RTVector tmp_r; if(!cloud.IsInCloud(current_r)) return(true); for(step=0; step