com.swfm.mica.core
Class MiVector

java.lang.Object
  extended bycom.swfm.mica.core.MiVector

public class MiVector
extends java.lang.Object

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
 double x
           
 double y
           
 
Constructor Summary
MiVector()
          Constructs a new MiVector.
MiVector(double x, double y)
          Constructs a new MiVector.
MiVector(MiVector other)
          Constructs a new MiVector that is a copy of the given vector.
 
Method Summary
 void add(double tx, double ty)
          Adds the given components to this vector.
 void add(MiVector other)
          Adds the components of the given vector to this.
 void copy(MiVector other)
          Copies the components of the given vector.
 boolean equals(MiVector other)
          Returns whether this equals the given vector.
 boolean isZero()
          Return whether the components of this vector are zero.
 void set(double vx, double vy)
          Set the components of this vector to the given values.
 java.lang.String toString()
          Return text that describes this vector.
 void zeroOut()
          Set the components of this vector to zero.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y
Constructor Detail

MiVector

public MiVector()
Constructs a new MiVector.


MiVector

public MiVector(MiVector other)
Constructs a new MiVector that is a copy of the given vector.

Parameters:
other - the vector to copy

MiVector

public MiVector(double x,
                double y)
Constructs a new MiVector.

Parameters:
x - the x component
y - the y component
Method Detail

set

public void set(double vx,
                double vy)
Set the components of this vector to the given values.

Parameters:
vx - the x component
vy - the y component

add

public void add(MiVector other)
Adds the components of the given vector to this.

Parameters:
other - the vector to add to this one

add

public void add(double tx,
                double ty)
Adds the given components to this vector.

Parameters:
tx - the x component to add to this
ty - the y component to add to this

copy

public void copy(MiVector other)
Copies the components of the given vector.

Parameters:
other - the vector to copy

equals

public boolean equals(MiVector other)
Returns whether this equals the given vector.

Parameters:
other - the vector to compare this with
Returns:
true if they are equal

zeroOut

public void zeroOut()
Set the components of this vector to zero.


isZero

public boolean isZero()
Return whether the components of this vector are zero.

Returns:
true if all components of this vector are zero.

toString

public java.lang.String toString()
Return text that describes this vector.