- #1
m3the01
- 4
- 0
Please correct anything i have wrong, I am not a physics guy :-). So my skills are lacking.
Say i have two points a and b. I wish to have a velocity vector in the direction from a to b with a 1-100 KeV range.
c = b - a;
0.5 mV^2 = eV
V = sqrt(2eV/m)
m = 9.1094e-31; //electron weight
mineV = sqrt(2000/m);
maxeV = sqrt(200000/m);
Range = maxeV - mineV;
value = mineV + (range * (float)rand()/((float)RAND_MAX+1))
So this gives me my random velocies in the range of 1-100 KeV.
However i have a velocity vector defined in cartesian space (xyz).
So how could i insure all particles have a velocity of 1-100KeV?
Also, if i have a velocity vector V how do i get the overall velocity of the particle?
I was thinking it should just be sqrt(V.x^2 + V.y^2 + V.z^2);
Thanks and sorry for the long post,
I greatly appreciate the help!
- m3the01
Say i have two points a and b. I wish to have a velocity vector in the direction from a to b with a 1-100 KeV range.
c = b - a;
0.5 mV^2 = eV
V = sqrt(2eV/m)
m = 9.1094e-31; //electron weight
mineV = sqrt(2000/m);
maxeV = sqrt(200000/m);
Range = maxeV - mineV;
value = mineV + (range * (float)rand()/((float)RAND_MAX+1))
So this gives me my random velocies in the range of 1-100 KeV.
However i have a velocity vector defined in cartesian space (xyz).
So how could i insure all particles have a velocity of 1-100KeV?
Also, if i have a velocity vector V how do i get the overall velocity of the particle?
I was thinking it should just be sqrt(V.x^2 + V.y^2 + V.z^2);
Thanks and sorry for the long post,
I greatly appreciate the help!
- m3the01