# ConstantSpline

#### new Cesium.ConstantSpline(value)
engine/Source/Core/ConstantSpline.js 26

A spline that evaluates to a constant value. Although this follows the `Spline` interface, it does not maintain an internal array of times since its value never changes.

Name | Type | Description
--- | --- | ---
`value` | number | Cartesian3 | Quaternion | The constant value that the spline evaluates to.

##### Example:

    const position = new Cesium.Cartesian3(1.0, 2.0, 3.0);
    const spline = new Cesium.ConstantSpline(position);

    const p0 = spline.evaluate(0.0);

##### See:

- LinearSpline
- HermiteSpline
- CatmullRomSpline
- QuaternionSpline
- MorphWeightSpline

### Members

#### readonly value : number|Cartesian3|Quaternion
engine/Source/Core/ConstantSpline.js 40

The constant value that the spline evaluates to.

### Methods

#### clampTime(time) → number
engine/Source/Core/ConstantSpline.js 88

Clamps the given time to the period covered by the spline.

Name | Type | Description
--- | --- | ---
`time` | number | The time.

##### Returns:

The time, clamped to the animation period.

#### evaluate(time, result) → number|Cartesian3|Quaternion
engine/Source/Core/ConstantSpline.js 104

Evaluates the curve at a given time.

Name | Type | Description
--- | --- | ---
`time` | number | The time at which to evaluate the curve.
`result` | Cartesian3 | Quaternion | optional The object onto which to store the result.

##### Returns:

The modified result parameter or the value that the constant spline represents.

#### findTimeInterval(time)
engine/Source/Core/ConstantSpline.js 58

Finds an index `i` in `times` such that the parameter `time` is in the interval `[times[i], times[i + 1]]`. Since a constant spline has no internal times array, this will throw an error.

Name | Type | Description
--- | --- | ---
`time` | number | The time.

##### Throws:

- DeveloperError : findTimeInterval cannot be called on a ConstantSpline.

#### wrapTime(time) → number
engine/Source/Core/ConstantSpline.js 73

Wraps the given time to the period covered by the spline.

Name | Type | Description
--- | --- | ---
`time` | number | The time.

##### Returns:

The time, wrapped around to the updated animation.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.