com.vividsolutions.jts.algorithm

Class HCoordinate


public class HCoordinate
extends java.lang.Object

Represents a homogeneous coordinate for 2-D coordinates.
Version:
1.6

Field Summary

double
w
double
x
double
y

Constructor Summary

HCoordinate()
HCoordinate(HCoordinate p1, HCoordinate p2)
HCoordinate(Coordinate p)
HCoordinate(double _x, double _y, double _w)

Method Summary

Coordinate
getCoordinate()
double
getX()
double
getY()
static Coordinate
intersection(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)
Computes the (approximate) intersection point between two line segments using homogeneous coordinates.

Field Details

w

public double w

x

public double x

y

public double y

Constructor Details

HCoordinate

public HCoordinate()

HCoordinate

public HCoordinate(HCoordinate p1,
                   HCoordinate p2)

HCoordinate

public HCoordinate(Coordinate p)

HCoordinate

public HCoordinate(double _x,
                   double _y,
                   double _w)

Method Details

getCoordinate

public Coordinate getCoordinate()
            throws NotRepresentableException

getX

public double getX()
            throws NotRepresentableException

getY

public double getY()
            throws NotRepresentableException

intersection

public static Coordinate intersection(Coordinate p1,
                                      Coordinate p2,
                                      Coordinate q1,
                                      Coordinate q2)
            throws NotRepresentableException
Computes the (approximate) intersection point between two line segments using homogeneous coordinates.

Note that this algorithm is not numerically stable; i.e. it can produce intersection points which lie outside the envelope of the line segments themselves. In order to increase the precision of the calculation input points should be normalized before passing them to this routine.