Class pv.Force.drag
Extends
pv.Force.
Implements a drag force, simulating friction. The drag force is
applied in the opposite direction of the particle's velocity. Since Position
Verlet integration does not track velocities explicitly, the error term with
this estimate of velocity is fairly high, so the drag force may be
inaccurate.
Defined in: DragForce.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Constructs a new drag force with the specified constant.
|
Method Attributes | Method Name and Description |
---|---|
apply(particles)
Applies this force to the specified particles.
|
|
constant(x)
Sets or gets the drag constant, in the range [0,1].
|
Class Detail
pv.Force.drag(k)
Constructs a new drag force with the specified constant.
- Parameters:
- {number} k
- the drag constant.
- See:
- #constant
Method Detail
apply(particles)
Applies this force to the specified particles.
- Parameters:
- {pv.Particle} particles
- particles to which to apply this force.
{pv.Force.drag}
constant(x)
Sets or gets the drag constant, in the range [0,1]. The default drag
constant is 0.1. The drag forces scales linearly with the particle's
velocity based on the given drag constant.
- Parameters:
- {number} x
- the new drag constant.
- Returns:
- {pv.Force.drag} this, or the current drag constant.