Table of Contents

Class SegmentPointComparator

Namespace
NetTopologySuite.Noding
Assembly
NetTopologySuite.dll

Implements a robust method of comparing the relative position of two points along the same segment. The coordinates are assumed to lie "near" the segment. This means that this algorithm will only return correct results if the input coordinates have the same precision and correspond to rounded values of exact coordinates lying on the segment.

public class SegmentPointComparator
Inheritance
SegmentPointComparator
Inherited Members

Constructors

SegmentPointComparator()

public SegmentPointComparator()

Methods

Compare(Octants, Coordinate, Coordinate)

Compares two Coordinates for their relative position along a segment lying in the specified Octant.

public static int Compare(Octants octant, Coordinate p0, Coordinate p1)

Parameters

octant Octants
p0 Coordinate
p1 Coordinate

Returns

int

-1 if node0 occurs first, or
0 if the two nodes are equal, or
1 if node1 occurs first.

RelativeSign(double, double)

public static int RelativeSign(double x0, double x1)

Parameters

x0 double
x1 double

Returns

int