%calculation of the pointing probability of the photon to the receiver
 function [pointto_]=pointto_receiver(positioninoriginal_,receiver_,g_)
pointto_.pointpath=norm(positioninoriginal_-receiver_.positioninoriginal);
%cosine of the pointing angle
pointcos_=dot(positioninoriginal_-receiver_.positioninoriginal,receiver_.normal)/...
    (norm(positioninoriginal_-receiver_.positioninoriginal)*norm(receiver_.normal));
%scale of the pointing solid angle among the whole solid angle (4*pi)
pointto_.pointweightscale=1*(pointcos_)/pointto_.pointpath^2/4/pi;
%value of the  Henyey-Greenstein scattering phase function
valuephasefunction_=(1-g_^2)/(1+g_^2-2*g_*pointcos_)^(1.5);
%update of the scale of the pointing solid angle according to the value of
%the scattering phase function
pointto_.pointweightscale=pointto_.pointweightscale*valuephasefunction_;
%judging whether the pointing direction is in the FOV of the receiver or
%not, if yes, pointto_.pointdetector=1, if no, pointto_.pointdetector=0;
pointto_.pointdetector=(acos(pointcos_)<=receiver_.delta);
end
