# derivativeTypes in SampledProperty?

Hello,

I keep seeing the "derivativeTypes" parameter when reviewing the SampledProperty code and/or documentation and keep wondering what it does and if it may be helpful to me.

Can somebody provide an explanation of what the derivateTypes parameter is and how it would be used? And maybe a simple example.

Thank you!

This feature is not fully finished, which is why it’s not well documented.

HermitePolynomialApproximation can use derivative information to produce better interpolation results. Currently, this means using velocity information to interpolate position. Cartesian properties in CZML can be specified as “cartesianVelocity” to load both position samples and velocity samples into a SampledPositionProperty.

In the current code, derivativeTypes is always an array containing the type Cartesian (the derivative of a Cartesian position is a Cartesian velocity) but in the future the types may be different. (For example, I believe the derivative of a Quaternion orientation is a Cartesian)

We used this feature in the NORAD Tracks Santa app last year to give better visual quality. Specifically, Hermite degree 3 to interpolate position with velocity, and Lagrange degree 1 to interpolate orientation.

Thanks for the explanation Scott. So if I know what my speed is in MPH at the same time as my position sample, can this be used to improve interpolation? How would you create the Cartesian from MPH?

Cesium uses SI units exclusively, so in this case, since the position is X/Y/Z meters in the Earth Fixed coordinate system, the velocity must be meters/second in that X/Y/Z coordinate system, i.e. a three dimensional velocity vector, not just a scalar speed.

If your data does not contain true velocity information, then I suspect higher-order interpolation is probably not useful.

I would go even further and state the unless you have precise velocity information that accurately correlates with position, it will actually reduce the quality of interpolation.

Scott,

I'm not sure I follow what you are saying. A speed value IS a velocity vector... referenced locally to the object. If we know the entity's position and orientation, the speed value can be converted to the world coordinate vector.

Matthew, if I DID have very precise speed information correlated with position, would my quality of interpolation improve by providing velocity as a derivative? What type of difference would I notice compared to only providing position and orientation?

It’s hard to describe. You might see less "wiggle’ at sharp banks and turns. You might not see any difference at all. It depends on what type of data you have. If it’s a highly maneuvering aircraft, it will make a difference. If you have a car, probably not. The average use case will not benefit from Hermite interpolation with velocity information, it’s just not needed.