|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--Force
| Field Summary | |
private double |
myAngle
|
private double |
myMagnitude
|
| Constructor Summary | |
Force(double angle,
double magnitude)
Constructor &/ public Force () { this(0.0, 0.0); } /** Constructor |
|
Force(Force other)
Constructor from another force |
|
Force(int dx,
int dy)
Constructor with detla x, delta y |
|
Force(java.awt.Point source,
java.awt.Point target)
Constructor with points source and target point |
|
| Method Summary | |
void |
accelerate(double change)
accelerates the boid by change amount |
Force |
add(Force other)
add forces |
Force |
difference(Force other)
returns teh differnec of two forces |
boolean |
equals(java.lang.Object force)
returns true if two forces are equal |
double |
getAngle()
Returns the angle moving at |
double |
getAngleBetween(Force other)
returns the angle between to forces |
double |
getMagnitude()
Returns magnitude |
double |
getRelativeMagnitude(Force other)
returns the relative magnitude |
double |
getXChange()
returns delta x |
double |
getYChange()
returns detla y |
static void |
main(java.lang.String[] args)
|
Force |
negate()
negates a forece |
private void |
setAngle(double value)
sets the angle |
private void |
setMagnitude(double value)
Sets the magnitude |
static int |
stringToInt(java.lang.String numStr)
convert string to int |
java.lang.String |
toString()
overriden for outputting |
void |
turn(double change)
turns |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private double myAngle
private double myMagnitude
| Constructor Detail |
public Force(double angle,
double magnitude)
angle - : angle to move atmagnitude: - magnitude to move
public Force(int dx,
int dy)
public Force(java.awt.Point source,
java.awt.Point target)
public Force(Force other)
| Method Detail |
public double getMagnitude()
public double getRelativeMagnitude(Force other)
public void accelerate(double change)
private void setMagnitude(double value)
public double getAngle()
public double getAngleBetween(Force other)
public void turn(double change)
private void setAngle(double value)
public double getXChange()
public double getYChange()
public Force add(Force other)
public Force difference(Force other)
public Force negate()
public boolean equals(java.lang.Object force)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static int stringToInt(java.lang.String numStr)
public static void main(java.lang.String[] args)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||