public override void Add(TValue value) { // Get position for the new point. TMath position = default(TMath); if (_data.Count > 0) { // Add the new key point, with the accumulated distance since the last key point. KeyPoint last = _data[_data.Count - 1]; TMath distance = DistanceBetween(last.Value, value); position = Operator <TMath> .Add(last.Position, distance); } // Create new key point. var newKeyPoint = new KeyPoint { Position = position, Value = value }; // Update data range. if (_dataRange == null) { // First object has zero distance. _dataRange = new Interval <TMath>(_zero, _zero); } else { _dataRange = _dataRange.ExpandTo(position); } _data.Add(newKeyPoint); }