Class: LinearSpline

LinearSpline

new LinearSpline()

使用分段线性插值创建的样条曲线。

Name Type Description
options.times Array.<Number>

严格递增、无单位的浮点时间数组。这些值与时钟时间无关。它们是曲线的参数化。

options.points Array.<Cartesian3>

Cartesian3 控制点数组。

See:
Throws:
  • points.length 必须大于或等于 2。

    Type
    DeveloperError
  • times.length 必须与 points.length 相等。

    Type
    DeveloperError
Example
var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
var spline = new SuperMap3D.LinearSpline({
    times : times,
    points : [
        new SuperMap3D.Cartesian3(1235398.0, -4810983.0, 4146266.0),
        new SuperMap3D.Cartesian3(1372574.0, -5345182.0, 4606657.0),
        new SuperMap3D.Cartesian3(-757983.0, -5542796.0, 4514323.0),
        new SuperMap3D.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
        new SuperMap3D.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
    ]
});

var p0 = spline.evaluate(times[0]);

Members

readonly pointsArray.<Cartesian3>

Cartesian3 控制点数组。

readonly timesArray.<Number>

控制点的时间数组。

Methods

evaluate(time, result){Cartesian3}

在给定时间评估曲线。

Name Type Description
time Number

评估曲线的时间。

result Cartesian3 可选

存储结果的对象。

Throws:

Time必须在[t0,tn]范围内,其中t0是数组times中的第一个元素,tn是数组times中的最后一个元素。

Type
DeveloperError
Returns:
Type Description
Cartesian3 修改后的结果参数或给定时间内曲线上点的新实例。

findTimeInterval(time){Number}

times中查找索引i,使得参数time[times[i],times[i + 1]]区间内。

Name Type Description
time Number

时间。

Throws:

Time必须在[t0, tn]范围内,其中t0是数组times中的第一个元素,tn是数组times中的最后一个元素。

Type
DeveloperError
Returns:
Type Description
Number 区间起始点元素的索引。