HCoordinate.from2c constructor

HCoordinate.from2c(
  1. Coordinate p1,
  2. Coordinate p2
)

Constructs a homogeneous coordinate which is the intersection of the lines define by the homogenous coordinates represented by two {@link Coordinate}s.

@param p1 @param p2

Implementation

HCoordinate.from2c(Coordinate p1, Coordinate p2) {
  // optimization when it is known that w = 1
  x = p1.y - p2.y;
  y = p2.x - p1.x;
  w = p1.x * p2.y - p2.x * p1.y;
}