GEOS 3.14.0dev
Distance.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2018 Paul Ramsey <pramsey@cleverlephant.ca>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: algorithm/Distance.java @ 2017-09-04
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22#include <geos/geom/Coordinate.h>
23#include <geos/geom/CoordinateSequence.h>
24
25namespace geos {
26namespace algorithm { // geos::algorithm
27
34class GEOS_DLL Distance {
35public:
36
51 // formerly distanceLineLine
52 static double segmentToSegment(
53 const geom::CoordinateXY& A,
54 const geom::CoordinateXY& B,
55 const geom::CoordinateXY& C,
56 const geom::CoordinateXY& D);
57
67 static double pointToSegmentString(
68 const geom::CoordinateXY& p,
69 const geom::CoordinateSequence* seq);
70
84 // formerly distancePointLine
85 static double pointToSegment(
86 const geom::CoordinateXY& p,
87 const geom::CoordinateXY& A,
88 const geom::CoordinateXY& B);
89
102 // formerly distancePointLinePerpendicular
104 const geom::CoordinateXY& p,
105 const geom::CoordinateXY& A,
106 const geom::CoordinateXY& B);
107
108 static double pointToLinePerpendicularSigned(
109 const geom::CoordinateXY& p,
110 const geom::CoordinateXY& A,
111 const geom::CoordinateXY& B);
112};
113
114} // namespace geos::algorithm
115} // namespace geos
116
Functions to compute distance between basic geometric structures.
Definition Distance.h:34
static double pointToSegment(const geom::CoordinateXY &p, const geom::CoordinateXY &A, const geom::CoordinateXY &B)
static double segmentToSegment(const geom::CoordinateXY &A, const geom::CoordinateXY &B, const geom::CoordinateXY &C, const geom::CoordinateXY &D)
static double pointToSegmentString(const geom::CoordinateXY &p, const geom::CoordinateSequence *seq)
static double pointToLinePerpendicular(const geom::CoordinateXY &p, const geom::CoordinateXY &A, const geom::CoordinateXY &B)
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
Basic namespace for all GEOS functionalities.
Definition geos.h:39