22 #ifndef GEOS_GEOM_LINESEGMENT_H
23 #define GEOS_GEOM_LINESEGMENT_H
25 #include <geos/export.h>
26 #include <geos/geom/Coordinate.h>
28 #include <geos/inline.h>
36 class CoordinateSequence;
37 class GeometryFactory;
74 LineSegment(
double x0,
double y0,
double x1,
double y1);
83 const Coordinate& operator[](std::size_t i)
const;
89 double getLength()
const;
95 bool isHorizontal()
const;
101 bool isVertical()
const;
124 int orientationIndex(
const LineSegment& seg)
const;
127 int orientationIndex(
const LineSegment* seg)
const;
145 int orientationIndex(
const Coordinate& p)
const;
158 double angle()
const;
176 double distancePerpendicular(
const Coordinate& p)
const;
192 void pointAlong(
double segmentLengthFraction,
Coordinate& ret)
const;
218 void pointAlongOffset(
double segmentLengthFraction,
219 double offsetDistance,
239 double projectionFactor(
const Coordinate& p)
const;
256 double segmentFraction(
const Coordinate& inputPt)
const;
382 # include "geos/geom/LineSegment.inl"
385 #endif // ndef GEOS_GEOM_LINESEGMENT_H
Definition: LineSegment.h:58
Coordinate p1
Segment start.
Definition: LineSegment.h:65
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:61
GEOS_DLL std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
GEOS_DLL bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:60