SampledProperty derivatives

I have just started using ***SampledProperty ***a few days ago thanks to Matthew.
I’ve found some erros in the documentation, as well as huge gaps as to how to use these features.

  • The example at the ***VelocityOrientationProperty *** has an error.
    It calls:var position = new Cesium.SampledProperty();

    ``

    Which returns an error since SampledProperty expects a type.

  • What are the derivatives mentioned in ***SampledProperty ***? How can one use them?

  • Why should I use SampledPositionProperty and not SampledProperty(Cesium.Cartesian3)?

  • When I try the example from SampledProperty for material, it doesn’t work. It works for outline color, but not for material color. I’ve tried several ways, but all resulted in a certain error. Here’s one code I thought might work, but it doesn’t:
    // Dates

    var date = new Date();

    var jDate = new Cesium.JulianDate.fromDate(date);

    //Create a material sampled property

    var materialProperty = new Cesium.SampledProperty(Cesium.ColorMaterialProperty);

    //Populate it with data

    materialProperty.addSample(jDate, new Cesium.ColorMaterialProperty(Cesium.Color.RED)); //throws an error

    ``

    Or if I try a different one like this:
    // Dates

    var date = new Date();

    var jDate = new Cesium.JulianDate.fromDate(date);

    //Create a color sampled property

    var colorProperty = new Cesium.SampledProperty(Cesium.Color);

    colorProperty.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD;

    //Populate it with data

    colorProperty.addSample(jDate, Cesium.Color.RED);

    colorProperty.addSample(nextJDate, Cesium.Color.BLUE);

    var redEllipse = viewer.entities.add({

    position: positionProperty,

    name : ‘Red ellipse on surface with outline’,

    ellipse : {

    semiMinorAxis : 250000.0,

    semiMajorAxis : 400000.0,

    material : colorProperty,

    outline : true,

    outlineColor : colorProperty

    }

    });

    ``

    Would also throw an error for the material (if I just add a regular *Color *to the material, it does work… but not with a sampled one).
    Would appreciate some light shed over this one (and maybe an improvement to the docs would arise from this post…).