Interface GeometricPredicates_2

All Known Implementing Classes:
ApproximatePredicates_2, ExactPredicates_2, FilteredPredicates_2

public interface GeometricPredicates_2
Interface defining geometric predicates for plane objects (points, segments, rays)
Version:
2.0, updated 12/11/2022 (created dec 2012)
Author:
Luca Castelli Aleardi and Steve Oudot (INF562, Ecole Polytechnique)
  • Method Details

    • orientation

      int orientation(Point_2 a, Point_2 b, Point_2 c)
      Returns the orientation of a, b and c
      Parameters:
      a - ,b,c the 3 points to test
      Returns:
      1 if sequence (a, b, c) turns in counter-clockwise direction, -1 if it turns in clockwise direction, 0 if the points are collinear
    • isCounterClockwise

      boolean isCounterClockwise(Point_2 a, Point_2 b, Point_2 c)
      Returns true if a, b and c turn in counter-clockwise direction Warning: the result is false if the three points are collinear
      Parameters:
      a - ,b,c the 3 points to test
      Returns:
      true if a, b and c turn in counter-clockwise direction
    • isClockwise

      boolean isClockwise(Point_2 a, Point_2 b, Point_2 c)
      Returns true if a, b and c turn in clockwise direction.
      Warning: the result is false if the three points are collinear
      Parameters:
      a - ,b,c the 3 points to test
      Returns:
      true if a, b and c turn in clockwise direction
    • collinear

      boolean collinear(Point_2 a, Point_2 b, Point_2 c)
      Returns true if a, b and c lie on a same line
      Parameters:
      a - ,b,c the 3 points to test
      Returns:
      true if a, b and c are collinear (lie on a same line)
    • inCircle

      boolean inCircle(Point_2 p, Point_2 a, Point_2 b, Point_2 c)
      Tests if point p lies inside the circumcircle of triangle a,b,c
      Parameters:
      p - point to test
      a - ,b,c triangle
      Returns:
      true/false
    • doIntersect

      boolean doIntersect(Segment_2 s, Segment_2 t)
      Returns true if segments s and t intersect
      Parameters:
      s - ,t the 2 segments
      Returns:
      true if s,t intersect each other
    • doIntersect

      boolean doIntersect(Segment_2 s, Ray_2 r)
      Returns true if segment s and ray r intersect
      Parameters:
      s - the segment
      r - the ray
      Returns:
      true if s intersects r
    • liesOn

      boolean liesOn(Point_2 p, Point_2 a, Point_2 b)
      Returns true if point p lies on segment ab
      Parameters:
      a - ,b,p the 3 points
      Returns:
      true if ab contains point p