/** @return The derivative of the spline at position u of the specified span */ public T derivativeAt (final T out, final int span, final float u) { return derivative(out, continuous ? span : (span + 1), u, controlPoints, continuous, tmp); }
/** @return The derivative of the spline at position u of the specified span */ public T derivativeAt (final T out, final int span, final float u) { return derivative(out, continuous ? span : (span + 1), u, controlPoints, continuous, tmp); }
/** Calculates the derivative of the catmullrom spline for the given position (t). * @param out The Vector to set to the result. * @param t The position (0<=t<=1) on the spline * @param points The control points * @param continuous If true the b-spline restarts at 0 when reaching 1 * @param tmp A temporary vector used for the calculation * @return The value of out */ public static <T extends Vector<T>> T derivative (final T out, final float t, final T[] points, final boolean continuous, final T tmp) { final int n = continuous ? points.length : points.length - 3; float u = t * n; int i = (t >= 1f) ? (n - 1) : (int)u; u -= i; return derivative(out, i, u, points, continuous, tmp); }
/** Calculates the derivative of the catmullrom spline for the given position (t). * @param out The Vector to set to the result. * @param t The position (0<=t<=1) on the spline * @param points The control points * @param continuous If true the b-spline restarts at 0 when reaching 1 * @param tmp A temporary vector used for the calculation * @return The value of out */ public static <T extends Vector<T>> T derivative (final T out, final float t, final T[] points, final boolean continuous, final T tmp) { final int n = continuous ? points.length : points.length - 3; float u = t * n; int i = (t >= 1f) ? (n - 1) : (int)u; u -= i; return derivative(out, i, u, points, continuous, tmp); }
/** @return The derivative of the spline at position u of the specified span */ public T derivativeAt (final T out, final int span, final float u) { return derivative(out, continuous ? span : (span + 1), u, controlPoints, continuous, tmp); }
/** Calculates the derivative of the catmullrom spline for the given position (t). * @param out The Vector to set to the result. * @param t The position (0<=t<=1) on the spline * @param points The control points * @param continuous If true the b-spline restarts at 0 when reaching 1 * @param tmp A temporary vector used for the calculation * @return The value of out */ public static <T extends Vector<T>> T derivative (final T out, final float t, final T[] points, final boolean continuous, final T tmp) { final int n = continuous ? points.length : points.length - 3; float u = t * n; int i = (t >= 1f) ? (n - 1) : (int)u; u -= i; return derivative(out, i, u, points, continuous, tmp); }