Rotation

external interface Rotation(source)

Represents a Packable number that always interpolates values towards the shortest angle of rotation. This object is never used directly but is instead passed to the constructor of SampledProperty in order to represent a two-dimensional angle of rotation.

const time1 = JulianDate.fromIso8601('2010-05-07T00:00:00');
const time2 = JulianDate.fromIso8601('2010-05-07T00:01:00');
const time3 = JulianDate.fromIso8601('2010-05-07T00:02:00');

const property = new SampledProperty(Rotation);
property.addSample(time1, 0);
property.addSample(time3, Math.toRadians(350));

//Getting the value at time2 will equal 355 degrees instead
//of 175 degrees (which is what you get if you construct
//a SampledProperty(Number) instead. Note, the actual
//return value is in radians, not degrees.
property.getValue(time2);

See also

Types

Link copied to clipboard