class Segment extends GM_LineSegment {

  public IDirectPosition getWeightedMiddlePoint(double ratio) {
    Vector2D vect = new Vector2D(getStartPoint(), getEndPoint());
    if (ratio == 1.0)
      return this.getMiddlePoint();
    else if (ratio < 1) {
      vect.scalarMultiplication(ratio / 2.0);
      return vect.translate(getStartPoint());
    } else {
      vect.scalarMultiplication(3.0 / (2.0 * ratio));
      return vect.translate(getStartPoint());
    }
  }

  public  Segment(IDirectPosition point1, IDirectPosition point2);

}