code: public static double getMeanSlope( List<ProfilePoint> points ) {
          double meanSlope = 0;
  
          int num = 0;
          for( int i = 0; i < points.size() - 1; i++ ) {
              ProfilePoint p1 = points.get(i);
              ProfilePoint p2 = points.get(i + 1);
  
              double dx = p2.progressive - p1.progressive;
              double dy = p2.elevation - p1.elevation;
              double tmpSlope = dy / dx;
              meanSlope = meanSlope + tmpSlope;
              num++;
          }
          meanSlope = meanSlope / num;
          return meanSlope;
      }
docs: Calculates the mean slope of a given set of profilepoints.
  
  @param points the points of the profile.
  @return the mean slope.