Class: SampledPositionProperty

SampledPositionProperty

new SampledPositionProperty(referenceFrame, numberOfDerivatives)

It is both a SampledProperty and a PositionProperty.

Name Type Default Description
referenceFrame ReferenceFrame ReferenceFrame.FIXED optional

Define the reference frame for the position.

numberOfDerivatives Number 0 optional

The number of derivatives accompanying each position, such as velocity, acceleration, etc

Members

backwardExtrapolationDurationNumber

Gets or sets the amount of time to infer backwards before the attribute becomes undefined. If the value is 0, it will be extrapolated forever.

Default Value:
0

backwardExtrapolationTypeExtrapolationType

Get or set the type of extrapolation method, which is executed when the requested value is earlier than any available sample.

Default Value:
ExtrapolationType.NONE

readonly definitionChangedEvent

Get the event thrown when the property definition changes. If calling getValue returns different results within the same time frame, it is considered that the definition has changed.

forwardExtrapolationDurationNumber

Gets or sets the amount of time to infer forward before the attribute becomes undefined. If the value is 0, it will be extrapolated forever.

Default Value:
0

forwardExtrapolationTypeExtrapolationType

Retrieve or set the type of extrapolation method to be executed when requesting values after any available samples.

Default Value:
ExtrapolationType.NONE

interpolationAlgorithmInterpolationAlgorithm

Obtain the interpolation algorithm used when obtaining numerical values.

Default Value:
LinearApproximation

interpolationDegreeNumber

The degree of interpolation to be performed when obtaining numerical values.

Default Value:
1

readonly isConstantBoolean

Get a value indicating whether the attribute is a constant. If getValue always returns the same result in the current definition, then the property is considered a constant.

numberOfDerivativesBoolean

The number of derivatives contained in this attribute, i.e. 0 represents position, 1 represents velocity, etc.

Default Value:
false

referenceFrameReferenceFrame

Get the reference frame for defining the location.

Default Value:
ReferenceFrame.FIXED;

Methods

addSample(time, position, derivatives)

Add a new sample.

Name Type Description
time JulianDate

Sampling time.

position Cartesian3

T is at the designated time location.

derivatives Array.<Cartesian3> optional

The derivative value array at the provided time point.

addSamples(times, positions, derivatives)

Add multiple samples through a parallel array.

Name Type Description
times Array.<JulianDate>

An array of JulianDate instances, where each index is an example time.

positions Array.<Cartesian3>

An array of Cartesian3 positional instances, where each value corresponds to the provided time index.

derivatives Array.<Array> optional

An array where each value is another array containing the derivative of the corresponding time index.

Throws:

All arrays must have the same length.

Type
DeveloperError

addSamplesPackedArray(packedSamples, epoch)

Add samples in the form of a single packaged array, where each new sample is represented by a date, followed by a packaged representation of the corresponding value and derivative.

Name Type Description
packedSamples Array.<Number>

An array of packaged samples.

epoch JulianDate optional

If any date in packkedsamples is a number, they are considered as the offset of that epoch, measured in seconds.

equals(other){Boolean}

Compare this attribute with the provided attribute, return true if they are equal, otherwise return false.

Name Type Description
other Property optional

A property value.

Returns:
Type Description
Boolean If left and right are equal, it is true; otherwise, it is false.

getValue(time, result){Cartesian3}

Obtain the location of the provided time.

Name Type Description
time JulianDate

The time to retrieve the value.

result Cartesian3 optional

If the object to store numerical values is omitted, a new instance will be created and returned.

Returns:
Type Description
Cartesian3 The modified result parameters, or a new instance (if no result parameters are provided).

getValueInReferenceFrame(time, referenceFrame, result){Cartesian3}

Obtain the position in the provided time and reference frame.

Name Type Description
time JulianDate

The time to retrieve the value.

referenceFrame ReferenceFrame

The required result reference frame.

result Cartesian3 optional

If the object to store numerical values is omitted, a new instance will be created and returned.

Returns:
Type Description
Cartesian3 The modified result parameters, or a new instance (if no result parameters are provided).

removeSample(time){Boolean}

Delete a sample at a specified time

Name Type Description
time JulianDate

specified time

Returns:
Type Description
Boolean Sample deletion returns true, otherwise returns false.

removeSamples(time)

Delete samples from the specified time period

Name Type Description
time TimeInterval

Specify a time period.

setInterpolationOptions()

The algorithm and degree used when setting position interpolation.

Name Type Description
options.interpolationAlgorithm InterpolationAlgorithm optional

New interpolation algorithm. If not defined, existing attributes will remain unchanged.

options.interpolationDegree Number optional

New interpolation degree. If not defined, existing attributes will remain unchanged.