yzt
2023-05-26 de4278af2fd46705a40bac58ec01122db6b7f3d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import DeveloperError from "./DeveloperError.js";
 
/**
 * The interface for interpolation algorithms.
 *
 * @interface InterpolationAlgorithm
 *
 * @see LagrangePolynomialApproximation
 * @see LinearApproximation
 * @see HermitePolynomialApproximation
 */
var InterpolationAlgorithm = {};
 
/**
 * Gets the name of this interpolation algorithm.
 * @type {String}
 */
InterpolationAlgorithm.type = undefined;
 
/**
 * Given the desired degree, returns the number of data points required for interpolation.
 * @function
 *
 * @param {Number} degree The desired degree of interpolation.
 * @returns {Number} The number of required data points needed for the desired degree of interpolation.
 */
InterpolationAlgorithm.getRequiredDataPoints =
  DeveloperError.throwInstantiationError;
 
/**
 * Performs zero order interpolation.
 * @function
 *
 * @param {Number} x The independent variable for which the dependent variables will be interpolated.
 * @param {Number[]} xTable The array of independent variables to use to interpolate.  The values
 * in this array must be in increasing order and the same value must not occur twice in the array.
 * @param {Number[]} yTable The array of dependent variables to use to interpolate.  For a set of three
 * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
 * @param {Number} yStride The number of dependent variable values in yTable corresponding to
 * each independent variable value in xTable.
 * @param {Number[]} [result] An existing array into which to store the result.
 *
 * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.
 */
InterpolationAlgorithm.interpolateOrderZero =
  DeveloperError.throwInstantiationError;
 
/**
 * Performs higher order interpolation.  Not all interpolators need to support high-order interpolation,
 * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.
 * @function
 * @param {Number} x The independent variable for which the dependent variables will be interpolated.
 * @param {Number[]} xTable The array of independent variables to use to interpolate.  The values
 * in this array must be in increasing order and the same value must not occur twice in the array.
 * @param {Number[]} yTable The array of dependent variables to use to interpolate.  For a set of three
 * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
 * @param {Number} yStride The number of dependent variable values in yTable corresponding to
 * each independent variable value in xTable.
 * @param {Number} inputOrder The number of derivatives supplied for input.
 * @param {Number} outputOrder The number of derivatives desired for output.
 * @param {Number[]} [result] An existing array into which to store the result.
 * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.
 */
InterpolationAlgorithm.interpolate = DeveloperError.throwInstantiationError;
export default InterpolationAlgorithm;