Class Force

java.lang.Object
  |
  +--Force

public class Force
extends java.lang.Object


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
, clone, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

myAngle

private double myAngle

myMagnitude

private double myMagnitude
Constructor Detail

Force

public Force(double angle,
             double magnitude)
Constructor &/ public Force () { this(0.0, 0.0); } /** Constructor
Parameters:
angle - : angle to move at
magnitude: - magnitude to move

Force

public Force(int dx,
             int dy)
Constructor with detla x, delta y

Force

public Force(java.awt.Point source,
             java.awt.Point target)
Constructor with points source and target point

Force

public Force(Force other)
Constructor from another force
Method Detail

getMagnitude

public double getMagnitude()
Returns magnitude

getRelativeMagnitude

public double getRelativeMagnitude(Force other)
returns the relative magnitude

accelerate

public void accelerate(double change)
accelerates the boid by change amount

setMagnitude

private void setMagnitude(double value)
Sets the magnitude

getAngle

public double getAngle()
Returns the angle moving at

getAngleBetween

public double getAngleBetween(Force other)
returns the angle between to forces

turn

public void turn(double change)
turns

setAngle

private void setAngle(double value)
sets the angle

getXChange

public double getXChange()
returns delta x

getYChange

public double getYChange()
returns detla y

add

public Force add(Force other)
add forces

difference

public Force difference(Force other)
returns teh differnec of two forces

negate

public Force negate()
negates a forece

equals

public boolean equals(java.lang.Object force)
returns true if two forces are equal
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
overriden for outputting
Overrides:
toString in class java.lang.Object

stringToInt

public static int stringToInt(java.lang.String numStr)
convert string to int

main

public static void main(java.lang.String[] args)