public void setCurve(double[] coords, int offset) { setCurve( coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]); }
public void setCurve(double[] coords, int offset) { setCurve( coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]); }
public static void subdivide(CubicCurve2D src, CubicCurve2D left, CubicCurve2D right) { double x1 = src.getX1(); double y1 = src.getY1(); double cx1 = src.getCtrlX1(); double cy1 = src.getCtrlY1(); double cx2 = src.getCtrlX2(); double cy2 = src.getCtrlY2(); double x2 = src.getX2(); double y2 = src.getY2(); double cx = (cx1 + cx2) / 2.0; double cy = (cy1 + cy2) / 2.0; cx1 = (x1 + cx1) / 2.0; cy1 = (y1 + cy1) / 2.0; cx2 = (x2 + cx2) / 2.0; cy2 = (y2 + cy2) / 2.0; double ax = (cx1 + cx) / 2.0; double ay = (cy1 + cy) / 2.0; double bx = (cx2 + cx) / 2.0; double by = (cy2 + cy) / 2.0; cx = (ax + bx) / 2.0; cy = (ay + by) / 2.0; if (left != null) { left.setCurve(x1, y1, cx1, cy1, ax, ay, cx, cy); } if (right != null) { right.setCurve(cx, cy, bx, by, cx2, cy2, x2, y2); } }
public static void subdivide(CubicCurve2D src, CubicCurve2D left, CubicCurve2D right) { double x1 = src.getX1(); double y1 = src.getY1(); double cx1 = src.getCtrlX1(); double cy1 = src.getCtrlY1(); double cx2 = src.getCtrlX2(); double cy2 = src.getCtrlY2(); double x2 = src.getX2(); double y2 = src.getY2(); double cx = (cx1 + cx2) / 2.0; double cy = (cy1 + cy2) / 2.0; cx1 = (x1 + cx1) / 2.0; cy1 = (y1 + cy1) / 2.0; cx2 = (x2 + cx2) / 2.0; cy2 = (y2 + cy2) / 2.0; double ax = (cx1 + cx) / 2.0; double ay = (cy1 + cy) / 2.0; double bx = (cx2 + cx) / 2.0; double by = (cy2 + cy) / 2.0; cx = (ax + bx) / 2.0; cy = (ay + by) / 2.0; if (left != null) { left.setCurve(x1, y1, cx1, cy1, ax, ay, cx, cy); } if (right != null) { right.setCurve(cx, cy, bx, by, cx2, cy2, x2, y2); } }
public void setCurve(Point2D[] points, int offset) { setCurve( points[offset + 0].getX(), points[offset + 0].getY(), points[offset + 1].getX(), points[offset + 1].getY(), points[offset + 2].getX(), points[offset + 2].getY(), points[offset + 3].getX(), points[offset + 3].getY()); }
public void setCurve(Point2D[] points, int offset) { setCurve( points[offset + 0].getX(), points[offset + 0].getY(), points[offset + 1].getX(), points[offset + 1].getY(), points[offset + 2].getX(), points[offset + 2].getY(), points[offset + 3].getX(), points[offset + 3].getY()); }
public void setCurve(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2) { setCurve( p1.getX(), p1.getY(), cp1.getX(), cp1.getY(), cp2.getX(), cp2.getY(), p2.getX(), p2.getY()); }
public void setCurve(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2) { setCurve( p1.getX(), p1.getY(), cp1.getX(), cp1.getY(), cp2.getX(), cp2.getY(), p2.getX(), p2.getY()); }
public void setCurve(CubicCurve2D curve) { setCurve( curve.getX1(), curve.getY1(), curve.getCtrlX1(), curve.getCtrlY1(), curve.getCtrlX2(), curve.getCtrlY2(), curve.getX2(), curve.getY2()); }
public void setCurve(CubicCurve2D curve) { setCurve( curve.getX1(), curve.getY1(), curve.getCtrlX1(), curve.getCtrlY1(), curve.getCtrlX2(), curve.getCtrlY2(), curve.getX2(), curve.getY2()); }