function [photon_]=photon_path(photon_,ke_,ks_)
%sample of the free optical depth
opticaldepth_=-(log(1-rand()));
%calculation of the path of the photon
photonpath_=opticaldepth_/ke_;
%the current position of the photon in the new reference frame
photon_.position=photon_.position+[0 0 photonpath_]';
%the current position of the photon in the original reference frame
photon_.positioninoriginal=inv(photon_.matrix)*photon_.position;
%update of the path of the photon
photon_.path=photon_.path+photonpath_;
%update of the scattering count of the photon
photon_.scattercount=photon_.scattercount+1;
%update of the weight of the photon according to absorption
photon_.weight=photon_.weight*ks_/ke_;
end
