Distance.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2018 Paul Ramsey <pramsey@cleverlephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: algorithm/Distance.java @ 2017-09-04
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Coordinate.h>
#include <geos/geom/CoordinateSequence.h>
namespace geos {
namespace algorithm { // geos::algorithm
class GEOS_DLL Distance {
public:
// formerly distanceLineLine
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);
// formerly distancePointLine
static double pointToSegment(
const geom::CoordinateXY& p,
const geom::CoordinateXY& A,
const geom::CoordinateXY& B);
// formerly distancePointLinePerpendicular
static double pointToLinePerpendicular(
const geom::CoordinateXY& p,
const geom::CoordinateXY& A,
const geom::CoordinateXY& B);
static double pointToLinePerpendicularSigned(
const geom::CoordinateXY& p,
const geom::CoordinateXY& A,
const geom::CoordinateXY& B);
};
} // namespace geos::algorithm
} // namespace geos
geos::algorithm::Distance
Functions to compute distance between basic geometric structures.
Definition Distance.h:34
geos::algorithm::Distance::pointToSegment
static double pointToSegment(const geom::CoordinateXY &p, const geom::CoordinateXY &A, const geom::CoordinateXY &B)
geos::algorithm::Distance::segmentToSegment
static double segmentToSegment(const geom::CoordinateXY &A, const geom::CoordinateXY &B, const geom::CoordinateXY &C, const geom::CoordinateXY &D)
geos::algorithm::Distance::pointToSegmentString
static double pointToSegmentString(const geom::CoordinateXY &p, const geom::CoordinateSequence *seq)
geos::algorithm::Distance::pointToLinePerpendicular
static double pointToLinePerpendicular(const geom::CoordinateXY &p, const geom::CoordinateXY &A, const geom::CoordinateXY &B)
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38