module

Geo::Utils

Instance methods

orientation(p : Geo::Coord, q : Geo::Coord, r : Geo::Coord)

Orientation of ordered triplet (p, q, r)

Orientation of an ordered triplet of points in the plane can be

  • counterclockwise
  • clockwise
  • colinear

The function returns following values 0 --> p, q and r are colinear 1 --> Clockwise 2 --> Counterclockwise

Source