class Segment extends GM_LineSegment {

  public boolean containsPoint(IDirectPosition point, double tolerance) {
    Vector2D vect1 = new Vector2D(startPoint(), point);
    Vector2D vect2 = new Vector2D(point, endPoint());
    Vector2D vect3 = new Vector2D(startPoint(), endPoint());
    if (!vect1.isColinear(vect2, tolerance))
      return false;

    double kAC = vect3.prodScalaire(vect1);
    double kAB = vect3.prodScalaire(vect3);
    if (kAC < 0)
      return false;
    if (kAC > kAB)
      return false;

    return true;
  }

  public  Segment(IDirectPosition point1, IDirectPosition point2);

}