ch.epfl.craft.maglib.magnet
Class Spring

java.lang.Object
  extended bych.epfl.craft.maglib.magnet.Spring

public class Spring
extends java.lang.Object

A spring to be manipulated in a spring layout

A Spring is a physical abstract spring between two points. Note not to make the k of the spring bigger than 1 - uncontrollable oscillatory motion in the springlayout model

Version:
1.0
Author:
Gregory Dyke

Field Summary
protected  SpringPoint head
           
protected  double konstant
           
protected  double length
           
protected  SpringPoint tail
           
 
Constructor Summary
Spring(SpringPoint head, SpringPoint tail, double length, double konstant)
          Create a new SpringPoint
 
Method Summary
 SpringPoint getHead()
           
 SpringPoint getTail()
           
 Vector2D headForce()
           
 Vector2D tailForce()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

protected SpringPoint head

tail

protected SpringPoint tail

length

protected double length

konstant

protected double konstant
Constructor Detail

Spring

public Spring(SpringPoint head,
              SpringPoint tail,
              double length,
              double konstant)
Create a new SpringPoint

Method Detail

getHead

public SpringPoint getHead()

getTail

public SpringPoint getTail()

headForce

public Vector2D headForce()

tailForce

public Vector2D tailForce()

toString

public java.lang.String toString()


Copyright © CRAFT EPFL. All Rights Reserved.