code: public void setLine(Point2D[] points) {
          double[] pd = new double[points.length * 2];
          for (int i = 0; i < points.length; i++) {
              Point2D p = points[i];
              pd[i * 2] = p.getX();
              pd[i * 2 + 1] = p.getY();
          }
          setLine(pd);
      }
docs: Sets the curve using control points given as Point2D objects
  
  @param points
  the control points for the curve