com.vividsolutions.jts.triangulate.quadedge
Class Vertex

java.lang.Object
  extended bycom.vividsolutions.jts.triangulate.quadedge.Vertex
Direct Known Subclasses:
ConstraintVertex

public class Vertex
extends java.lang.Object

Models a site (node) in a QuadEdgeSubdivision. The sites can be points on a lineString representing a linear site. The vertex can be considered as a vector with a norm, length, inner product, cross product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle defined by this point and two others, etc.) are also defined in this class.

Author:
David Skea, Martin Davis

Field Summary
static int BEHIND
           
static int BETWEEN
           
static int BEYOND
           
static int DESTINATION
           
static int LEFT
           
static int ORIGIN
           
static int RIGHT
           
 
Constructor Summary
Vertex(Coordinate _p)
           
Vertex(double _x, double _y)
           
Vertex(double _x, double _y, double _z)
           
 
Method Summary
 Vertex circleCenter(Vertex b, Vertex c)
          Computes the centre of the circumcircle of this vertex and two others.
 double circumRadiusRatio(Vertex b, Vertex c)
          Computes the value of the ratio of the circumradius to shortest edge.
 int classify(Vertex p0, Vertex p1)
           
 boolean equals(Vertex _x)
           
 boolean equals(Vertex _x, double tolerance)
           
 Coordinate getCoordinate()
           
 double getX()
           
 double getY()
           
 double getZ()
           
 boolean inCircle(Vertex a, Vertex b, Vertex c)
          Tests if this is inside the circle defined by the points a, b, c.
static double interpolateZ(Coordinate p, Coordinate p0, Coordinate p1)
          Computes the interpolated Z-value for a point p lying on the segment p0-p1
static double interpolateZ(Coordinate p, Coordinate v0, Coordinate v1, Coordinate v2)
          Interpolates the Z value of a point enclosed in a 3D triangle.
 double interpolateZValue(Vertex v0, Vertex v1, Vertex v2)
          For this vertex enclosed in a triangle defined by three verticies v0, v1 and v2, interpolate a z value from the surrounding vertices.
 boolean isCCW(Vertex b, Vertex c)
          Tests whether the triangle formed by this vertex and two other vertices is in CCW orientation.
 boolean leftOf(QuadEdge e)
           
 Vertex midPoint(Vertex a)
          returns a new vertex that is mid-way between this vertex and another end point.
 boolean rightOf(QuadEdge e)
           
 void setZ(double _z)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

BEYOND

public static final int BEYOND
See Also:
Constant Field Values

BEHIND

public static final int BEHIND
See Also:
Constant Field Values

BETWEEN

public static final int BETWEEN
See Also:
Constant Field Values

ORIGIN

public static final int ORIGIN
See Also:
Constant Field Values

DESTINATION

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

Vertex

public Vertex(double _x,
              double _y)

Vertex

public Vertex(double _x,
              double _y,
              double _z)

Vertex

public Vertex(Coordinate _p)
Method Detail

getX

public double getX()

getY

public double getY()

getZ

public double getZ()

setZ

public void setZ(double _z)

getCoordinate

public Coordinate getCoordinate()

toString

public java.lang.String toString()

equals

public boolean equals(Vertex _x)

equals

public boolean equals(Vertex _x,
                      double tolerance)

classify

public int classify(Vertex p0,
                    Vertex p1)

inCircle

public final boolean inCircle(Vertex a,
                              Vertex b,
                              Vertex c)
Tests if this is inside the circle defined by the points a, b, c. This test uses simple double-precision arithmetic, and thus may not be robust.

Parameters:
a -
b -
c -
Returns:
true if this point is inside the circle defined by the points a, b, c

isCCW

public final boolean isCCW(Vertex b,
                           Vertex c)
Tests whether the triangle formed by this vertex and two other vertices is in CCW orientation.

Parameters:
b - a vertex
c - a vertex

rightOf

public final boolean rightOf(QuadEdge e)

leftOf

public final boolean leftOf(QuadEdge e)

circumRadiusRatio

public double circumRadiusRatio(Vertex b,
                                Vertex c)
Computes the value of the ratio of the circumradius to shortest edge. If smaller than some given tolerance B, the associated triangle is considered skinny. For an equal lateral triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: circumRadius/shortestEdge = 1/(2sin(theta)).

Parameters:
b - second vertex of the triangle
c - third vertex of the triangle
Returns:
ratio of circumradius to shortest edge.

midPoint

public Vertex midPoint(Vertex a)
returns a new vertex that is mid-way between this vertex and another end point.

Parameters:
a - the other end point.
Returns:
the point mid-way between this and that.

circleCenter

public Vertex circleCenter(Vertex b,
                           Vertex c)
Computes the centre of the circumcircle of this vertex and two others.

Parameters:
b -
c -
Returns:
the Coordinate which is the circumcircle of the 3 points.

interpolateZValue

public double interpolateZValue(Vertex v0,
                                Vertex v1,
                                Vertex v2)
For this vertex enclosed in a triangle defined by three verticies v0, v1 and v2, interpolate a z value from the surrounding vertices.


interpolateZ

public static double interpolateZ(Coordinate p,
                                  Coordinate v0,
                                  Coordinate v1,
                                  Coordinate v2)
Interpolates the Z value of a point enclosed in a 3D triangle.


interpolateZ

public static double interpolateZ(Coordinate p,
                                  Coordinate p0,
                                  Coordinate p1)
Computes the interpolated Z-value for a point p lying on the segment p0-p1

Parameters:
p -
p0 -
p1 -
Returns: