org.gicentre.utils.network.traer.physics
Class Drag

java.lang.Object
  extended by org.gicentre.utils.network.traer.physics.Function<Particle,Particle>
      extended by org.gicentre.utils.network.traer.physics.Drag

public class Drag
extends Function<Particle,Particle>

Class capable of applying the drag on a particle to inhibit its motion.

Author:
Carl Pearson, Jeffrey Traer Bernstein and minor modifications by Jo Wood.

Field Summary
static float DEFAULT_DRAG
           
 
Constructor Summary
Drag()
          Creates a drag with the default value.
Drag(float drag)
          Creates a drag with the given value.
 
Method Summary
 Particle apply(Particle p)
          Applies this drag to the given particle.
 Drag setDrag(float drag)
          Sets the drag to the given value.
 
Methods inherited from class org.gicentre.utils.network.traer.physics.Function
combine, functor, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DRAG

public static final float DEFAULT_DRAG
See Also:
Constant Field Values
Constructor Detail

Drag

public Drag()
Creates a drag with the default value.


Drag

public Drag(float drag)
Creates a drag with the given value.

Parameters:
drag - Drag to apply to particles.
Method Detail

setDrag

public Drag setDrag(float drag)
Sets the drag to the given value.

Parameters:
drag - Drag to apply to particles.
Returns:
The drag with the newly modified value.

apply

public Particle apply(Particle p)
Applies this drag to the given particle.

Specified by:
apply in class Function<Particle,Particle>
Parameters:
p - Particle upon which to apply the drag.
Returns:
The particle with a modified velocity in response to this drag.


giCentre Utilities V.3.3, API documentation generated 6th April, 2013