drasys.or.geom.rect2
Class Point

java.lang.Object
  |
  +--drasys.or.geom.rect2.Rect2
        |
        +--drasys.or.geom.rect2.Point

public class Point
extends Rect2
implements PointI, java.io.Serializable

An implementation of a point in the 2D rectangular coordinate system.

See Also:
Serialized Form

Constructor Summary
Point(double[] coordinates)
           
Point(double x, double y)
           
Point(PointI point)
           
Point(VectorI coordinates)
           
 
Method Summary
 PointI centroid()
           
 double directionTo(PointI point)
          Returns the direction to the argument.
 double distanceProxyTo(PointI point)
          Returns an easily computable proxy that can be used to compare the distance from this point to the argument point.
 double distanceTo(PointI point)
          Returns the distance from this point to the argument point.
 boolean equals(java.lang.Object o)
           
static boolean equals(PointI a, PointI b, double accuracy)
           
 double getCoordinate(int i)
          Returns individual coordinates by ordinality.
 double getDirectionTo(PointI point)
          Returns the direction to the argument.
 int hashCode()
           
 PointI nearestPointTo(PointI point)
           
 RangeI range()
           
 java.lang.String toString()
           
 double x()
          Returns the X coordinate.
 double y()
          Returns the Y coordinate.
 
Methods inherited from class drasys.or.geom.rect2.Rect2
coordinateSystem, getCentroid, getDistanceProxyTo, getDistanceTo, getNearestPointTo, getRange
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Point

public Point(double x,
             double y)

Point

public Point(PointI point)

Point

public Point(VectorI coordinates)

Point

public Point(double[] coordinates)
Method Detail

range

public RangeI range()

centroid

public PointI centroid()

nearestPointTo

public PointI nearestPointTo(PointI point)

x

public double x()
Description copied from interface: PointI
Returns the X coordinate.
Specified by:
x in interface PointI

y

public double y()
Description copied from interface: PointI
Returns the Y coordinate.
Specified by:
y in interface PointI

getCoordinate

public double getCoordinate(int i)
Description copied from interface: PointI
Returns individual coordinates by ordinality.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public static boolean equals(PointI a,
                             PointI b,
                             double accuracy)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

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

getDirectionTo

public double getDirectionTo(PointI point)
Description copied from interface: PointI
Returns the direction to the argument. The return value is in the range -PI to +PI.

directionTo

public double directionTo(PointI point)
Returns the direction to the argument. The return value is in the range -PI to +PI and is measured from the direction of the positive x-axis. If angle is positive if 'point' is counterclockwise and negative if it is clockwise.
Specified by:
directionTo in interface PointI

distanceProxyTo

public double distanceProxyTo(PointI point)
Returns an easily computable proxy that can be used to compare the distance from this point to the argument point.

distanceTo

public double distanceTo(PointI point)
Returns the distance from this point to the argument point.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com