Particle Methods |
The Particle type exposes the following members.
Name | Description | |
---|---|---|
![]() | BounceOff |
Updates the velocities of this particle and the specified particle according
to the laws of elastic collision. Assumes that the particles are colliding
at this instant. |
![]() | BounceOffHorizontalWall |
Updates the velocity of this particle upon collision with a horizontal
wall (by reflecting the velocity in the Y-direction).
Assumes that the particle is colliding with a horizontal wall at this instant. |
![]() | BounceOffVerticalWall |
Updates the velocity of this particle upon collision with a vertical
wall (by reflecting the velocity in the X-direction).
Assumes that the particle is colliding with a vertical wall at this instant. |
![]() | Draw |
Draws the particle as a filled circle
(Overrides BasicVisualDraw.) |
![]() | KineticEnergy |
Returns the kinetic energy of this particle.
The kinetic energy is given by the formula 1/2 MV2,
where M is the Mass of this particle and V is its velocity. |
![]() | Move |
Moves this particle in a straight line (based on its velocity)
for the specified amount of time. |
![]() | TimeToHit |
Returns the amount of time for this particle to collide with the specified
particle, assuming no interening collisions. |
![]() | TimeToHitHorizontalWall |
Returns the amount of time for this particle to collide with a horizontal
wall, assuming no interening collisions. |
![]() | TimeToHitVerticalWall |
Returns the amount of time for this particle to collide with a vertical
wall, assuming no interening collisions. |
![]() | ToString |
Returns useful particle info for debugging
(Overrides ObjectToString.) |