GEOS 3.11.1
HCoordinate.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7 * Copyright (C) 2005-2006 Refractions Research Inc.
8 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************
16 *
17 * Last port: algorithm/HCoordinate.java r386 (JTS-1.12+)
18 *
19 **********************************************************************/
20
21#pragma once
22
23#include <geos/export.h>
24#include <iosfwd>
25
26// Forward declarations
27namespace geos {
28namespace geom {
29class Coordinate;
30}
31}
32
33namespace geos {
34namespace algorithm { // geos::algorithm
35
36
43class GEOS_DLL HCoordinate {
44
45public:
46
47 friend std::ostream& operator<< (std::ostream& o, const HCoordinate& c);
48
59 static void intersection(const geom::Coordinate& p1,
60 const geom::Coordinate& p2,
61 const geom::Coordinate& q1,
62 const geom::Coordinate& q2,
63 geom::Coordinate& ret);
64
65 double x, y, w;
66
68
69 HCoordinate(double _x, double _y, double _w);
70
72
82
84 const geom::Coordinate& q1, const geom::Coordinate& q2);
85
86 HCoordinate(const HCoordinate& p1, const HCoordinate& p2);
87
88 double getX() const;
89
90 double getY() const;
91
92 void getCoordinate(geom::Coordinate& ret) const;
93
94};
95
96std::ostream& operator<< (std::ostream& o, const HCoordinate& c);
97
98} // namespace geos::algorithm
99} // namespace geos
100
Represents a homogeneous coordinate in a 2-D coordinate space.
Definition: HCoordinate.h:43
HCoordinate(const geom::Coordinate &p1, const geom::Coordinate &p2)
Constructs a homogeneous coordinate which is the intersection of the lines define by the homogenous c...
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...
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Basic namespace for all GEOS functionalities.
Definition: geos.h:39