Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.vividsolutions.jts.noding
Class SegmentPointComparator

    java.lang.Object
      com.vividsolutions.jts.noding.SegmentPointComparator

public class SegmentPointComparator
extends java.lang.Object

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.

Version:
  1.7

Constructor Summary
`SegmentPointComparator()`

Method Summary
`static int` | `compare(int octant, Coordinate p0, Coordinate p1)` Compares two `Coordinate`s for their relative position along a segment lying in the specified `Octant`.
`static int` | `relativeSign(double x0, double x1)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SegmentPointComparator

    public SegmentPointComparator()

Method Detail

### compare

    public static int compare(int octant,
                              Coordinate p0,
                              Coordinate p1)

  Compares two `Coordinate`s for their relative position along a segment lying in the specified `Octant`.

  Returns:
    -1 node0 occurs first

### relativeSign

    public static int relativeSign(double x0,
                                   double x1)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD