maslab.geom
Class GPoint2D

java.lang.Object
  extended by maslab.geom.GPoint2D
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class GPoint2D
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A 2D point

See Also:
Serialized Form

Field Summary
static GPoint2D ORIGIN
           
 
Constructor Summary
GPoint2D()
           
GPoint2D(double x, double y)
           
 
Method Summary
 double distanceTo(GPoint2D p)
           
 double getX()
           
 double getY()
           
 GPoint2D scale(double s)
           
 java.lang.String toString()
           
 GPoint2D transform(double dx, double dy, double theta)
          Transform the point by rotating it, then translating it.
 GPoint2D transform(Matrix P)
          Transform the point by premultiplying by the provided 3x3 matrix.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ORIGIN

public static final GPoint2D ORIGIN
Constructor Detail

GPoint2D

public GPoint2D()

GPoint2D

public GPoint2D(double x,
                double y)
Method Detail

getX

public double getX()

getY

public double getY()

distanceTo

public double distanceTo(GPoint2D p)

transform

public GPoint2D transform(double dx,
                          double dy,
                          double theta)
Transform the point by rotating it, then translating it.


transform

public GPoint2D transform(Matrix P)
Transform the point by premultiplying by the provided 3x3 matrix.


scale

public GPoint2D scale(double s)

toString

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