JSci.physics
Class Spring

java.lang.Object
  extended byJSci.physics.Spring

public class Spring
extends java.lang.Object


Constructor Summary
Spring(double coeff)
          Constructs a mechanical spring.
 
Method Summary
 JSci.physics.Spring.Force createForce(AbstractClassicalParticle p)
           
 double energy(AbstractClassicalParticle p)
          Returns the potential energy of a particle attached to this spring.
 AbstractDoubleVector getPosition()
           
 void setPosition(AbstractDoubleVector pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spring

public Spring(double coeff)
Constructs a mechanical spring.

Parameters:
coeff - the spring constant.
Method Detail

setPosition

public void setPosition(AbstractDoubleVector pos)

getPosition

public AbstractDoubleVector getPosition()

energy

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


createForce

public JSci.physics.Spring.Force createForce(AbstractClassicalParticle p)