private List<Section> findCurveSections(
      List<Double> tangents, List<Point> points, double minHeightPerc) {
    List<Section> sections = new ArrayList<>();
    Double lastTg = null;
    Point lastPt = null;
    double totalHeight = calcHeight(points);
    double lastSectHeight = 0;
    for (int i = 0; i < tangents.size(); i++) {
      Double tangent = tangents.get(i);
      Point pt = points.get(i);
      double sign = Math.signum(tangent);

      if (sections.size() == 0) {
        sections.add(new Section(sign));
      } else if (sign != 0) {
        Section lastSect = sections.get(sections.size() - 1);
        if (lastSect.getSign() != sign) {
          lastSectHeight = calcHeight(lastSect.getPoints());
          if (lastSect.getPoints().size() > 1
              && (!(minHeightPerc > 0) || lastSectHeight / totalHeight > minHeightPerc)) {
            Section newSection = new Section(sign);
            sections.add(newSection);
            newSection.getPoints().add(lastPt);
            newSection.getTangents().add(lastTg);
          }
        }
      }

      Section lastSect = sections.get(sections.size() - 1);
      lastSect.getPoints().add(pt);
      lastSect.getTangents().add(tangent);
      lastTg = tangent;
      lastPt = pt;
    }

    int count = 0;
    Section prev = null;
    for (Section s : sections) {
      s.setId(count++);
      if (prev != null) {
        prev.getNext().add(new SectionNext(s));
      }
      prev = s;
    }
    prev.setNext(new ArrayList<>());

    return sections;
  }
Given a list of tangents it divides the list of tangents in a list of sections. Each section
shares the same tangent signs (a section could be an increasing curve or a decreasing curve,
but not both)

@return Array of sections.
library-udf/src/main/java/org/apache/iotdb/library/match/PatternExecutor.java