class OsmNogoPolygon extends OsmNodeNamed {

  public static boolean isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
  {
    final double v10x = px-p0x;
    final double v10y = py-p0y;
    final double v12x = p1x-p0x;
    final double v12y = p1y-p0y;

    if ( v10x == 0 ) // P0->P1 vertical?
    {
      if ( v10y == 0 ) // P0 == P1?
      {
        return true;
      }
      if ( v12x != 0 ) // P1->P2 not vertical?
      {
        return false;
      }
      return ( v12y / v10y ) >= 1; // P1->P2 at least as long as P1->P0?
    }
    if ( v10y == 0 ) // P0->P1 horizontal?
    {
      if ( v12y != 0 ) // P1->P2 not horizontal?
      {
        return false;
      }
      // if ( P10x == 0 ) // P0 == P1? already tested
      return ( v12x / v10x ) >= 1; // P1->P2 at least as long as P1->P0?
    }
    final double kx = v12x / v10x;
    if ( kx < 1 )
    {
      return false;
    }
    return kx == v12y / v10y;
  }

  public  OsmNogoPolygon(boolean closed);

}