GEOS 3.11.1
Static Public Member Functions | List of all members
geos::algorithm::Distance Class Reference

Functions to compute distance between basic geometric structures. More...

#include <Distance.h>

Static Public Member Functions

static double segmentToSegment (const geom::Coordinate &A, const geom::Coordinate &B, const geom::Coordinate &C, const geom::Coordinate &D)
 
static double pointToSegmentString (const geom::Coordinate &p, const geom::CoordinateSequence *seq)
 
static double pointToSegment (const geom::Coordinate &p, const geom::Coordinate &A, const geom::Coordinate &B)
 
static double pointToLinePerpendicular (const geom::Coordinate &p, const geom::Coordinate &A, const geom::Coordinate &B)
 

Detailed Description

Functions to compute distance between basic geometric structures.

Author
Martin Davis

Member Function Documentation

◆ pointToLinePerpendicular()

static double geos::algorithm::Distance::pointToLinePerpendicular ( const geom::Coordinate p,
const geom::Coordinate A,
const geom::Coordinate B 
)
static

Computes the perpendicular distance from a point p to the (infinite) line containing the points AB

Parameters
pthe point to compute the distance for
Aone point of the line
Banother point of the line (must be different to A)
Returns
the distance from p to line AB

Referenced by geos::geom::LineSegment::distancePerpendicular().

◆ pointToSegment()

static double geos::algorithm::Distance::pointToSegment ( const geom::Coordinate p,
const geom::Coordinate A,
const geom::Coordinate B 
)
static

Computes the distance from a point p to a line segment AB

Note: NON-ROBUST!

Parameters
pthe point to compute the distance for
Aone point of the line
Banother point of the line (must be different to A)
Returns
the distance from p to line segment AB

Referenced by geos::geom::LineSegment::distance().

◆ pointToSegmentString()

static double geos::algorithm::Distance::pointToSegmentString ( const geom::Coordinate p,
const geom::CoordinateSequence seq 
)
static

Computes the distance from a point to a sequence of line segments.

Parameters
pa point
seqa sequence of contiguous line segments defined by their vertices
Returns
the minimum distance between the point and the line segments

◆ segmentToSegment()

static double geos::algorithm::Distance::segmentToSegment ( const geom::Coordinate A,
const geom::Coordinate B,
const geom::Coordinate C,
const geom::Coordinate D 
)
static

Computes the distance from a line segment AB to a line segment CD

Note: NON-ROBUST!

Parameters
Aa point of one line
Bthe second point of (must be different to A)
Cone point of the line
Danother point of the line (must be different to A)

Referenced by geos::geom::LineSegment::distance().


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