Exemplo n.º 1
0
 /**
  * Evaluate a cubic Bézier curve according to control points `p0`, `p1`, `p2` and `p3` and store
  * the position at parametric position `t` of the curve in `result`.
  *
  * @return the given reference to `result`.
  */
 public static Point2 eval(Point2 p0, Point2 p1, Point2 p2, Point2 p3, double t, Point2 result) {
   result.set(eval(p0.x, p1.x, p2.x, p3.x, t), eval(p0.y, p1.y, p2.y, p3.y, t));
   return result;
 }
Exemplo n.º 2
0
 /**
  * Store in `result` the derivative point of a cubic Bézier curve according to control points
  * `x0`, `x1`, `x2` and `x3` at parametric position `t` of the curve.
  *
  * @return the given reference to `result`.
  */
 public static Point2 derivative(
     Point2 p0, Point2 p1, Point2 p2, Point3 p3, double t, Point2 result) {
   result.set(derivative(p0.x, p1.x, p2.x, p3.x, t), derivative(p0.y, p1.y, p2.y, p3.y, t));
   return result;
 }