module Geo::Utils

Extended Modules

Defined in:

geo/utils.cr

Instance Method Summary

Instance Method Detail

def 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