JTS Topology Suite version 1.12

## com.vividsolutions.jts.algorithm Class HCoordinate

```java.lang.Object
com.vividsolutions.jts.algorithm.HCoordinate
```

`public class HCoordinateextends java.lang.Object`

Represents a homogeneous coordinate in a 2-D coordinate space. In JTS `HCoordinate`s are used as a clean way of computing intersections between line segments.

Version:
1.7
Author:
David Skea

Field Summary
` double` `w`

` double` `x`

` double` `y`

Constructor Summary
`HCoordinate()`

`HCoordinate(Coordinate p)`

```HCoordinate(Coordinate p1, Coordinate p2)```
Constructs a homogeneous coordinate which is the intersection of the lines define by the homogenous coordinates represented by two `Coordinate`s.
```HCoordinate(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)```

```HCoordinate(double _x, double _y)```

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

```HCoordinate(HCoordinate p1, HCoordinate p2)```

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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### x

`public double x`

### y

`public double y`

### w

`public double w`
Constructor Detail

### HCoordinate

`public HCoordinate()`

### HCoordinate

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

### HCoordinate

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

### HCoordinate

`public HCoordinate(Coordinate p)`

### HCoordinate

```public HCoordinate(HCoordinate p1,
HCoordinate p2)```

### HCoordinate

```public HCoordinate(Coordinate p1,
Coordinate p2)```
Constructs a homogeneous coordinate which is the intersection of the lines define by the homogenous coordinates represented by two `Coordinate`s.

Parameters:
`p1` -
`p2` -

### HCoordinate

```public HCoordinate(Coordinate p1,
Coordinate p2,
Coordinate q1,
Coordinate q2)```
Method Detail

### 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.

Throws:
`NotRepresentableException`

### getX

```public double getX()
throws NotRepresentableException```
Throws:
`NotRepresentableException`

### getY

```public double getY()
throws NotRepresentableException```
Throws:
`NotRepresentableException`

### getCoordinate

```public Coordinate getCoordinate()
throws NotRepresentableException```
Throws:
`NotRepresentableException`

JTS Topology Suite version 1.12