Flight path zig-zag when interpolationDegree:5 (or greater than 3)

Hello,

I'm careful about saying this, but I think this is a bug.
When I set "interpolationDegree":5 below, the flight path zig-zags on playback. I've see this with a sampling of other flight tracks. I tried this on CZML Sandcastle demo and was able to reproduce the problem.

var czml = [{
"id":"document",
"name":"Traf5",
"version":"1.0"
},
{"id":"UAL1749-1",
"name":"UAL1749",
"description":"<div data-json=\"{'trackid':'UAL1749','acft_type':'B739','acft_equip':'L','depart_apt':'SFO','arrive_apt':'EWR','airline':'UAL'}\">SFO to EWR</div>","availability":"2015-03-01T11:11:16+00/2015-03-01T12:00:04+00",
"acft_type":"B739","acft_equip":"L","depart_apt":"SFO","arrive_apt":"EWR",
"point":{"show":[{"boolean":true}],"color":{"rgba":[255, 0, 0, 255]},"outlineColor":{"rgba":[255,255,0,255]},"pixelSize":6,"outlineWidth":0},
"label":{"fillColor":[{"rgba":[255,255,255,255]}], "font":"12px Sans-Serif","horizontalOrigin":"LEFT","outlineColor":{"rgba":[255,255,255,255]}, "pixelOffset":{"cartesian2":[8.0,-8.0]},"scale":1.0, "show":[{ "boolean":true}], "style":"FILL","text" : "UAL1749","verticalOrigin":"CENTER"},
"path":{
    "material":{"solidColor":{"color":{"rgba":[255,255,100,100]}}},"width":[ { "number":1.0}],"show":[{"interval": "2015-03-01T11:11:16+00/2015-03-01T12:00:04+00","boolean":true}],
    "resolution":2
},
"position":{
"interpolationAlgorithm":"LAGRANGE",
"interpolationDegree":5,
"cartographicDegrees": [
     "2015-03-01T11:11:16Z",-94.4514,42.6089,10058,
     "2015-03-01T11:12:28Z",-94.1858,42.60882,10058,
     "2015-03-01T11:20:29Z",-92.419467,42.516836,10058,
     "2015-03-01T11:22:42Z",-91.936442,42.485128,10058,
     "2015-03-01T11:23:18Z",-91.805695,42.477914,10058,
     "2015-03-01T11:23:30Z",-91.718922,42.473174,10058,
     "2015-03-01T11:27:19Z",-90.885013,42.411706,10058,
     "2015-03-01T11:31:31Z",-89.950522,42.355656,10058,
     "2015-03-01T11:31:43Z",-89.9067,42.3536,10058,
     "2015-03-01T11:31:56Z",-89.873815,42.352336,10058,
     "2015-03-01T11:32:20Z",-89.788125,42.349719,10058,
     "2015-03-01T11:35:45Z",-89.032743,42.301633,10058,
     "2015-03-01T11:36:33Z",-88.858886,42.289176,10058,
     "2015-03-01T11:36:45Z",-88.798549,42.285959,10058,
     "2015-03-01T11:39:09Z",-88.26749,42.245427,10058,
     "2015-03-01T11:41:46Z",-87.694445,42.205693,10058,
     "2015-03-01T11:42:11Z",-87.605032,42.203883,10058,
     "2015-03-01T11:45:35Z",-86.847063,42.159309,10058,
     "2015-03-01T11:46:12Z",-86.713344,42.150048,10058,
     "2015-03-01T11:46:24Z",-86.685722,42.150203,10058,
     "2015-03-01T11:49:24Z",-86.020878,42.10716,10058,
     "2015-03-01T11:49:36Z",-85.9511,42.1008,10058,
     "2015-03-01T11:53:37Z",-85.0764,42.0392,10058,
     "2015-03-01T11:54:26Z",-84.9017,42.0386,10058,
     "2015-03-01T11:57:38Z",-84.1997,42.0189,10058,
     "2015-03-01T12:00:04Z",-83.675,42.0008,10058 ]
}}
];

This looks like an artifact specific to your data. Higher-degree interpolation does not necessarily produce a more accurate curve. (I think this is Runge’s phenomenon but I’m not sure: https://en.wikipedia.org/wiki/Runge%27s_phenomenon ) I think this is worsened because your data is fairly sparse, and you have non-uniform sample times. You might be able to reduce the artifacts by introducing more samples, but realistically you should just lower the interpolation degree (as you say, degree 3 looks ok with your data).

Understood. But the Sandcastle demo of interpolationAlgorithm uses an aircraft. The very nature of aircraft track data is exactly as you describe, sparse and non-uniform. That interpolationAlgorithm demo promises a good solution for gaming, maybe, where the data can be controlled an imagined.

Still, a value of 3 for interpolationDegree improves the natural appearance of the data when a path connects the data points. I had one flight that was full of curves, which worked great, but this flight (above) was mostly straight, and seems to blow-up the algorithm. Funny, it reminds me of when I played pool, I had the most trouble with the straight shots.