Spirograph
Class Coord

java.lang.Object
  |
  +--Spirograph.Coord

public class Coord
extends java.lang.Object

This class holds information regarding one dimension of the ball. It has methods to update the position of the ball, as well as methods to get and set certain variables.

Copyright (C) 1996 Massachusetts Institute of Technology.

See Also:
AccelHandler, Spirograph

Constructor Summary
Coord()
           
 
Method Summary
 double getAccel()
           
 double getMaxPos()
           
 int getMode()
          Determines the current mode of operation, either position, velocity, or accleration control.
 double getPos()
           
 double getVel()
           
 void nextStep(java.util.Vector v, double step)
          Calculates the acceleration of the ball by taking the acceleration that was set and adding it to the combined accelerations resulting from each of the different gravitational fields.
 void setAccel(double accel)
           
 void setMaxPos(double pos)
           
 void setMode(int mode)
          Sets the current mode.
 void setPos(double pos)
           
 void setValue(double val)
           
 void setVel(double vel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Coord

public Coord()
Method Detail

getMode

public int getMode()
Determines the current mode of operation, either position, velocity, or accleration control.

setMode

public void setMode(int mode)
Sets the current mode. Legal parameter values are AccelHandler.POSMODE, AccelHandler.VELMODE, or AccelHandler.ACCELMODE.

getMaxPos

public double getMaxPos()

setMaxPos

public void setMaxPos(double pos)

getPos

public double getPos()

setPos

public void setPos(double pos)

getVel

public double getVel()

setVel

public void setVel(double vel)

getAccel

public double getAccel()

setAccel

public void setAccel(double accel)

setValue

public void setValue(double val)

nextStep

public void nextStep(java.util.Vector v,
                     double step)
Calculates the acceleration of the ball by taking the acceleration that was set and adding it to the combined accelerations resulting from each of the different gravitational fields.