Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Photon Tracking Code

  1. Nov 17, 2009 #1
    Hello all,

    I'm working on coding a program that tracks photons based on Compton Scattering. However, I'm having an issue on how to deal with photons with multiple scatters. So, phi (polar) and theta (azimuthal) range from 0-pi/2 and 0-2pi, respectively, based on a random number generator. How do I calculate the new dx, dy, and dz after the first scatter. I guess I'm just not sure how to represent the incident vector and its effect on the vector after collision.
  2. jcsd
  3. Nov 17, 2009 #2
    If I understand correctly your problem how to determine the position of the new vector in the original coordinate frame?

    IE, you have a particle with moving with vector (Vx,Vy,Vz) (or alternatively (V,theta,phi)) in the original frame. This particle then interacts by scattering causing it to change direction. The scattering angle is measured from the incident vector and this needs to be represented in the original frame.

    The only way I know how to do this is to use transformation matrices which can get messy pretty quickly. I've done similar problem for my robotics class in the pass, you may find it useful to look at the problem from a similar way.
    Try starting with this link:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook