public TwoDPoint getMidpoint() {
    double midpointX = (pointA.getX() + pointB.getX()) / 2;
    double midpointY = (pointA.getY() + pointB.getY()) / 2;

    TwoDPoint midpoint = new TwoDPoint(midpointX, midpointY);
    return midpoint;
  }
 public double getSlope() {
   double slope = (pointB.getY() - pointA.getY()) / (pointB.getX() - pointA.getX());
   return slope;
 }
 public double getLength() {
   double length = pointA.distanceToPoint(pointB);
   return length;
 }