Ray tracing between light source (mouse) and first OC
The points that we read form the csv file are not photons. They are lightning points. Every one of them will emit a number of photons in different directions (randomly). The number of photons emitted by every point should be set by the user. The more photons per point the more accurate the simulation would be, but the computational cost would get higher.
We already have a function mirror.getPlane().getPoint(radius, angle). You can use it to generate random point in the surface of the mirror, if wou five it a random angle [0,360] and a random radius [0, mirror.radius]. the generated photon direction will be the generated point position minus the the lightning point position. And the position of the generated photon will be the same as the lightning point. The wavelength of the generated photon should also be the same as that of the lightning point.
in opticalMachine.h
void OpticalMachine::generatePhotonsfromOnePoint(Position point){
photons.push_back(randomPhoton);
}
void OpticalMachine::generateAllPhotonsFromPointsVector(vector <Photon>){}