Class Diffusion.Electron
java.lang.Object
|
+--Diffusion.Electron
- Enclosing class:
- Diffusion
- public class Diffusion.Electron
- extends java.lang.Object
Class to simulate a single electron
|
Field Summary |
(package private) double |
x
|
(package private) double |
xv
|
(package private) double |
y
|
(package private) double |
yv
|
|
Constructor Summary |
Diffusion.Electron(double x,
double y,
double energy)
Creates a new electron, with the specified energy, but a random
direction. |
Diffusion.Electron(double x,
double y,
double xv,
double yv)
Creates a new electron |
|
Method Summary |
void |
paint(java.awt.Graphics g,
double xscl,
double yscl)
Plots this electron (as a filled circle). |
void |
update(double dt)
Updates the position and velocity of this electron to reflect
a change in time. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
x
double x
y
double y
xv
double xv
yv
double yv
Diffusion.Electron
public Diffusion.Electron(double x,
double y,
double xv,
double yv)
- Creates a new electron
- Parameters:
x - The initial x-coordinatey - The initial y-coordinatexv - The initial x component of the velocityyv - The initial y component of the velocity
Diffusion.Electron
public Diffusion.Electron(double x,
double y,
double energy)
- Creates a new electron, with the specified energy, but a random
direction.
- Parameters:
x - The initial x-coordinatey - The initial y-coordinateenergy - The energy of the electron
paint
public void paint(java.awt.Graphics g,
double xscl,
double yscl)
- Plots this electron (as a filled circle).
- Parameters:
g - The Graphics surface on which to paintxscl - The scaling factor for x coordinatesyscl - The scaling factor for y coordinates
update
public void update(double dt)
- Updates the position and velocity of this electron to reflect
a change in time. If the particle hits a wall, the appropriate
momentum component will be negated.