Class LinearDouble<T extends VectorDouble<T>>
java.lang.Object
gaiasky.util.math.LinearDouble<T>
- Type Parameters:
T- The type of the control points.
- All Implemented Interfaces:
PathDouble<T>
Implementation of linear interpolation between control points using double precision.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleapproximate(T v) doubleapproxLength(int samples) derivativeAt(T out, double t) double
-
Field Details
-
controlPoints
-
-
Constructor Details
-
LinearDouble
-
-
Method Details
-
set
-
derivativeAt
- Specified by:
derivativeAtin interfacePathDouble<T extends VectorDouble<T>>
-
valueAt
- Specified by:
valueAtin interfacePathDouble<T extends VectorDouble<T>>- Returns:
- The value of the path at t where 0≤t≤1
-
approximate
- Specified by:
approximatein interfacePathDouble<T extends VectorDouble<T>>- Returns:
- The approximated value (between 0 and 1) on the path which is closest to the specified value. Note that the
implementation of this method might be optimized for speed against precision, see
PathDouble.locate(Object)for a more precise (but more intensive) method.
-
locate
- Specified by:
locatein interfacePathDouble<T extends VectorDouble<T>>- Returns:
- The precise location (between 0 and 1) on the path which is closest to the specified value. Note that the
implementation of this method might be CPU intensive, see
PathDouble.approximate(Object)for a faster (but less precise) method.
-
approxLength
public double approxLength(int samples) - Specified by:
approxLengthin interfacePathDouble<T extends VectorDouble<T>>- Parameters:
samples- The amount of divisions used to approximate length. Higher values will produce more precise results, but will be more CPU intensive.- Returns:
- An approximated length of the spline through sampling the curve and accumulating the Euclidean distances between the sample points.
-