GEOS: geos::algorithm::HCoordinate Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Friends

# geos::algorithm::HCoordinate Class Reference

Represents a homogeneous coordinate in a 2-D coordinate space. More...

`#include <HCoordinate.h>`

List of all members.

## Public Member Functions
| HCoordinate (long double _x, long double _y, long double _w)
| HCoordinate (const geom::Coordinate &p)
| HCoordinate (const geom::Coordinate &p1, const geom::Coordinate &p2)
| Constructs a homogeneous coordinate which is the intersection of the lines define by the homogenous coordinates represented by two Coordinates.
| HCoordinate (const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q1, const geom::Coordinate &q2)
| HCoordinate (const HCoordinate &p1, const HCoordinate &p2)
long double | getX () const
long double | getY () const
void | getCoordinate (geom::Coordinate &ret) const
## Static Public Member Functions
static void | intersection (const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q1, const geom::Coordinate &q2, geom::Coordinate &ret)
| Computes the (approximate) intersection point between two line segments using homogeneous coordinates.
## Public Attributes
long double | x
long double | y
long double | w
## Friends
std::ostream & | operator<< (std::ostream &o, const HCoordinate &c)

## Detailed Description

Represents a homogeneous coordinate in a 2-D coordinate space.

HCoordinate are used as a clean way of computing intersections between line segments.

## Constructor & Destructor Documentation

geos::algorithm::HCoordinate::HCoordinate | ( | const geom::Coordinate & | p1,
|  | const geom::Coordinate & | p2
| ) |  |

Constructs a homogeneous coordinate which is the intersection of the lines define by the homogenous coordinates represented by two Coordinates.

Parameters:

  p1 |
  p2 |

## Member Function Documentation

static void geos::algorithm::HCoordinate::intersection | ( | const geom::Coordinate & | p1,
|  | const geom::Coordinate & | p2,
|  | const geom::Coordinate & | q1,
|  | const geom::Coordinate & | q2,
|  | geom::Coordinate & | ret
| ) |  | `[static]`

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.

The documentation for this class was generated from the following file:

- HCoordinate.h