com.swfm.mica.core
Class MiPoint

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

public class MiPoint
extends java.lang.Object

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

Field Summary
 double x
           
 double y
           
 
Constructor Summary
MiPoint()
          Constructs a new MiPoint.
MiPoint(double x, double y)
          Constructs a new MiPoint.
MiPoint(MiPoint other)
          Constructs a new MiPoint that is a copy of the given point.
 
Method Summary
 void copy(MiPoint other)
          Copies the coordinates of the given point.
 boolean equals(MiPoint other)
          Returns whether this equals the given point.
 double getDistanceSquared(MiPoint other)
          Gets the square of the distance between this point and teh given point.
 void scale(MiPoint center, MiScale scale)
          Scales the components of the this point by the given scale factor around the given center.
 void set(double px, double py)
          Set the coordinates of this point to the given values.
 java.lang.String toString()
          Return text that describes this point.
 void translate(double tx, double ty)
          Translates the components of the this point by the given vector.
 void translate(MiVector other)
          Translates the components of the this point by the given vector.
 
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

MiPoint

public MiPoint()
Constructs a new MiPoint.


MiPoint

public MiPoint(MiPoint other)
Constructs a new MiPoint that is a copy of the given point.

Parameters:
other - the point to copy

MiPoint

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

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

set

public void set(double px,
                double py)
Set the coordinates of this point to the given values.

Parameters:
px - the x coordinate
py - the y coordinate

copy

public void copy(MiPoint other)
Copies the coordinates of the given point.

Parameters:
other - the point to copy

translate

public void translate(MiVector other)
Translates the components of the this point by the given vector.

Parameters:
other - the vector to translate this by

translate

public void translate(double tx,
                      double ty)
Translates the components of the this point by the given vector.

Parameters:
tx - the x amount to translate this by
ty - the y amount to translate this by

scale

public void scale(MiPoint center,
                  MiScale scale)
Scales the components of the this point by the given scale factor around the given center.

Parameters:
center - the center to scale around
scale - the scale factor

equals

public boolean equals(MiPoint other)
Returns whether this equals the given point.

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

getDistanceSquared

public double getDistanceSquared(MiPoint other)
Gets the square of the distance between this point and teh given point. This is useful when find the smallest distance between this point and a set of other points.

Parameters:
other - the point to get the distance to
Returns:
the distance squared to the other point

toString

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