delaunay_triangulation
Class Point_dt

java.lang.Object
  extended by delaunay_triangulation.Point_dt

public class Point_dt
extends java.lang.Object

This class represents a 3D point, with some simple geometric methods (pointLineTest).


Field Summary
static int BEHINDB
          a---------b+
static int ERROR
           
static int INFRONTOFA
          +a---------b
static int LEFT
          +
a---------b
static int ONSEGMENT
          a----+----b
static int RIGHT
          a---------b
+
 
Constructor Summary
Point_dt()
           
Point_dt(double x, double y)
          constructs a 3D point with a z value of 0.
Point_dt(double x, double y, double z)
          constructs a 3D point
Point_dt(Point_dt p)
          simple copy constructor
 
Method Summary
 boolean equals(Point_dt p)
          return true iff this point [x,y] coordinates are the same as p [x,y] coordinates.
static java.util.Comparator<Point_dt> getComparator()
           
static java.util.Comparator<Point_dt> getComparator(int flag)
           
 int pointLineTest(Point_dt a, Point_dt b)
          tests the relation between this point (as a 2D [x,y] point) and a 2D segment a,b (the Z values are ignored), returns one of the following: LEFT, RIGHT, INFRONTOFA, BEHINDB, ONSEGMENT
 java.lang.String toString()
          return a String in the [x,y,z] format
 double x()
          returns the x-coordinate of this point.
 double y()
          returns the y-coordinate of this point.
 double z()
          returns the z-coordinate of this point.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ONSEGMENT

public static final int ONSEGMENT
a----+----b

See Also:
Constant Field Values

LEFT

public static final int LEFT
+
a---------b

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
a---------b
+

See Also:
Constant Field Values

INFRONTOFA

public static final int INFRONTOFA
+a---------b

See Also:
Constant Field Values

BEHINDB

public static final int BEHINDB
a---------b+

See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values
Constructor Detail

Point_dt

public Point_dt()

Point_dt

public Point_dt(double x,
                double y,
                double z)
constructs a 3D point


Point_dt

public Point_dt(double x,
                double y)
constructs a 3D point with a z value of 0.


Point_dt

public Point_dt(Point_dt p)
simple copy constructor

Method Detail

x

public double x()
returns the x-coordinate of this point.


y

public double y()
returns the y-coordinate of this point.


z

public double z()
returns the z-coordinate of this point.


equals

public boolean equals(Point_dt p)
return true iff this point [x,y] coordinates are the same as p [x,y] coordinates. (the z value is ignored).


toString

public java.lang.String toString()
return a String in the [x,y,z] format

Overrides:
toString in class java.lang.Object

pointLineTest

public int pointLineTest(Point_dt a,
                         Point_dt b)
tests the relation between this point (as a 2D [x,y] point) and a 2D segment a,b (the Z values are ignored), returns one of the following: LEFT, RIGHT, INFRONTOFA, BEHINDB, ONSEGMENT

Parameters:
a - the first point of the segment.
b - the second point of the segment.
Returns:
the value (flag) of the relation between this point and the a,b line-segment.

getComparator

public static java.util.Comparator<Point_dt> getComparator(int flag)

getComparator

public static java.util.Comparator<Point_dt> getComparator()