src/datatypes/simplefeaturecollection.cpp
/**
 * check if Coordinate c is on line given by Coordinate p1, p2
 * @param p1 start of line
 * @param p2 end of line
 * @param c coordinate to check, must be collinear to p1, p2
 * @return true if c is on line segment
 */
check if Coordinate c is on line given by Coordinate p1, p2
@param p1 start of line
@param p2 end of line
@param c coordinate to check, must be collinear to p1, p2
@return true if c is on line segment
check if Coordinate c is on line given by Coordinate p1 p2 @param p1 start of line @param p2 end of line @param c coordinate to check must be collinear to p1 p2 @return true if c is on line segment
bool onSegment(const Coordinate& p1, const Coordinate& p2, const Coordinate& c)
{
    if (c.x <= std::max(p1.x, p2.x) && c.x >= std::min(p1.x, p2.x) &&
        c.y <= std::max(p1.y, p2.y) && c.y >= std::min(p1.y, p2.y))
       return true;
    return false;
}
bool onSegment ( const Coordinate & p1 , const Coordinate & p2 , const Coordinate & c ) { if ( c . x <= std :: max ( p1 . x , p2 . x ) && c . x >= std :: min ( p1 . x , p2 . x ) && c . y <= std :: max ( p1 . y , p2 . y ) && c . y >= std :: min ( p1 . y , p2 . y ) ) return true ; return false ; }
check if Coordinate c is on line given by Coordinate p1, p2
 @param p1 start of line
 @param p2 end of line
 @param c coordinate to check, must be collinear to p1, p2
 @return true if c is on line segment
check if Coordinate c is on line given by Coordinate p1 p2 @param p1 start of line @param p2 end of line @param c coordinate to check must be collinear to p1 p2 @return true if c is on line segment