An
InterpolationAlgorithm 用于执行线性插值。 for performing linear interpolation.方法 Methods
给定所需的度数,返回插值所需的数据点数量。由于线性插值只能生成一次多项式,因此该函数始终返回 2。 Given the desired degree, returns the number of data points required for interpolation. Since linear interpolation can only generate a first degree polynomial, this function always returns 2.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
degree |
number | 所需的插值程度。 The desired degree of interpolation. |
返回: Returns:
该函数始终返回 2。 This function always returns 2.
static Cesium.LinearApproximation.interpolateOrderZero(x, xTable, yTable, yStride, result) → Array.<number>
使用线性近似插值。 Interpolates values using linear approximation.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
x |
number | 将对其插值因变量的自变量。 The independent variable for which the dependent variables will be interpolated. |
xTable |
Array.<number> | 用于插值的自变量数组。该数组中的值必须按递增顺序排列,并且相同的值不得在数组中出现两次。 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. |
yTable |
Array.<number> | 用于插值的因变量数组。对于时间 1 和时间 2 的一组三个相关值 (p,q,w),应如下所示:{p1, q1, w1, p2, q2, w2}。 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}. |
yStride |
number | yTable 中与 xTable 中每个自变量值相对应的因变量值的数量。 The number of dependent variable values in yTable corresponding to each independent variable value in xTable. |
result |
Array.<number> | 可选 optional 用于存储结果的现有数组。 An existing array into which to store the result. |
返回: Returns:
插值数组,或结果参数(如果提供)。 The array of interpolated values, or the result parameter if one was provided.
