|
Spirograph Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspirograph.Coord
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 © 1996 Massachusetts Institute of Technology.
Copyright © 2003 Franklin W. Olin College of Engineering.
AccelHandler
,
Spirograph
Constructor Summary | |
Coord()
|
Method Summary | |
double |
getAccel()
The acceleration along this axis. |
double |
getMaxPos()
The maximum position for this coordinate. |
int |
getMode()
Determines the current mode of operation, either position, velocity, or accleration control. |
double |
getPos()
The current position of this coordinate. |
double |
getVel()
The current velocity along this coordinate axis. |
void |
nextStep(java.util.Vector v,
double step)
Calculates the acceleration of the ball by taking the current acceleration and adding it to the combined accelerations resulting from each of the different gravitational fields. |
void |
setAccel(double accel)
Set the acceleration along this axis. |
void |
setMaxPos(double pos)
Set the maximum position for this coordinate |
void |
setMode(int mode)
Sets the current mode. |
void |
setPos(double pos)
Modify the current position of this coordinate. |
void |
setValue(double val)
Sets the position, velocity or acceleration depending on the current mode. |
void |
setVel(double vel)
Set the velocity along this axis. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Coord()
Method Detail |
public int getMode()
AccelHandler.POSMODE
, AccelHandler.VELMODE
or AccelHandler.ACCELMODE
public void setMode(int mode)
mode
- The desired modepublic double getMaxPos()
public void setMaxPos(double pos) throws java.lang.IllegalArgumentException
pos
- A positive value indicating the maximum position.
java.lang.IllegalArgumentException
- when pos < 0public double getPos()
-(getMaxPos())
and
getMaxPos()
public void setPos(double pos) throws java.lang.IllegalArgumentException
pos
- the desired new position
java.lang.IllegalArgumentException
- If the absolute value of the argument is
greater than getMaxPos()
public double getVel()
public void setVel(double vel)
vel
- The new value for the velocity along this axispublic double getAccel()
public void setAccel(double accel)
accel
- The new value for the acceleration along this axispublic void setValue(double val)
val
- The new value for the current movement mode.public void nextStep(java.util.Vector v, double step)
v
- A vector denoting the distance on this axis and the total distance from
every gravitational source.step
- The size of the step to calculate.
|
Spirograph Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |