org.jscience.physics.kinematics
Class Spring

java.lang.Object
  extended by org.jscience.physics.kinematics.Spring

public class Spring
extends java.lang.Object

The Spring class provides an object for encapsulating spring forces.


Constructor Summary
Spring(AbstractClassicalParticle p, AbstractDoubleVector position, double coefficient)
          Constructs a mechanical spring.
 
Method Summary
 Force createForce()
          DOCUMENT ME!
 double getCoefficient()
          DOCUMENT ME!
 AbstractClassicalParticle getParticle()
          DOCUMENT ME!
 double getPeriod()
          DOCUMENT ME!
 AbstractDoubleVector getPosition()
          DOCUMENT ME!
 double potentialEnergy()
          Returns the potential energy of a particle attached to this spring.
 void setCoefficient(double coefficient)
          DOCUMENT ME!
 void setPosition(AbstractDoubleVector position)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spring

public Spring(AbstractClassicalParticle p,
              AbstractDoubleVector position,
              double coefficient)
Constructs a mechanical spring.

Parameters:
p - DOCUMENT ME!
position - DOCUMENT ME!
coefficient - the spring constant.
Throws:
IllegalDimensionException - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!
Method Detail

getParticle

public AbstractClassicalParticle getParticle()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getPosition

public AbstractDoubleVector getPosition()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setPosition

public void setPosition(AbstractDoubleVector position)
DOCUMENT ME!

Parameters:
position - DOCUMENT ME!

getCoefficient

public double getCoefficient()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setCoefficient

public void setCoefficient(double coefficient)
DOCUMENT ME!

Parameters:
coefficient - DOCUMENT ME!

potentialEnergy

public double potentialEnergy()
Returns the potential energy of a particle attached to this spring.

Returns:
DOCUMENT ME!

getPeriod

public double getPeriod()
DOCUMENT ME!

Returns:
DOCUMENT ME!

createForce

public Force createForce()
DOCUMENT ME!

Returns:
DOCUMENT ME!