src/datatypes/simplefeaturecollection.cpp
/**
 * calculate orientation of coordinate c with respect to line from p1 to p2
 * @param p1 start of line
 * @param p2 end of line
 * @param c coordinate to check
 * @return the orientation of c
 */
calculate orientation of coordinate c with respect to line from p1 to p2
@param p1 start of line
@param p2 end of line
@param c coordinate to check
@return the orientation of c
calculate orientation of coordinate c with respect to line from p1 to p2 @param p1 start of line @param p2 end of line @param c coordinate to check @return the orientation of c
Orientation orientation(const Coordinate& p1, const Coordinate& p2, const Coordinate& c) {
    double val = (p2.y - p1.y) * (c.x - p2.x) -
              (p2.x - p1.x) * (c.y - p2.y);
    if (val == 0) return ON;  
    return (val > 0)? RIGHT: LEFT;
}
Orientation orientation ( const Coordinate & p1 , const Coordinate & p2 , const Coordinate & c ) { double val = ( p2 . y - p1 . y ) * ( c . x - p2 . x ) - ( p2 . x - p1 . x ) * ( c . y - p2 . y ) ; if ( val == 0 ) return ON ; return ( val > 0 ) ? RIGHT : LEFT ; }
calculate orientation of coordinate c with respect to line from p1 to p2
 @param p1 start of line
 @param p2 end of line
 @param c coordinate to check
 @return the orientation of c
calculate orientation of coordinate c with respect to line from p1 to p2 @param p1 start of line @param p2 end of line @param c coordinate to check @return the orientation of c
// colinear