public class HCoordinate extends Object
HCoordinates are used as a clean way
of computing intersections between line segments.| Constructor and Description |
|---|
HCoordinate() |
HCoordinate(double _x,
double _y) |
HCoordinate(double _x,
double _y,
double _w) |
HCoordinate(HCoordinate p1,
HCoordinate p2) |
HCoordinate(Point p) |
HCoordinate(Point p1,
Point p2)
Constructs a homogeneous coordinate which is the intersection of the lines
define by the homogenous coordinates represented by two
Coordinatess. |
HCoordinate(Point p1,
Point p2,
Point q1,
Point q2) |
| Modifier and Type | Method and Description |
|---|---|
Point |
getCoordinate() |
double |
getX() |
double |
getY() |
static Point |
intersection(Point p1,
Point p2,
Point q1,
Point q2)
Computes the (approximate) intersection point between two line segments
using homogeneous coordinates.
|
public HCoordinate()
public HCoordinate(double _x,
double _y)
public HCoordinate(double _x,
double _y,
double _w)
public HCoordinate(HCoordinate p1, HCoordinate p2)
public HCoordinate(Point p)
public HCoordinate(Point p1, Point p2)
Coordinatess.p1 - p2 - public static Point intersection(Point p1, Point p2, Point q1, Point q2) throws NotRepresentableException
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.
NotRepresentableExceptionpublic Point getCoordinate() throws NotRepresentableException
NotRepresentableExceptionpublic double getX()
throws NotRepresentableException
NotRepresentableExceptionpublic double getY()
throws NotRepresentableException
NotRepresentableExceptionCopyright © 2015 Revolution Systems Inc.. All rights reserved.