Exemplo n.º 1
0
        /// <summary>
        /// Create a new object to do cardinal spline interpolation.
        /// </summary>
        /// <param name = "keyPoints">The list of key points to interpolate between.</param>
        /// <param name = "tension">Specify a custom tension for the tangents. 1 will yield all zero tangents, 0.5 yields a Catmull-Rom spline (default).</param>
        public CardinalSplineInterpolation(AbstractKeyPointCollection <TValue, TMath> keyPoints, double tension)
            : base(keyPoints)
        {
            if (tension < 0 || tension > 1)
            {
                throw new ArgumentException("The tension should be a value between 0 and 1.", nameof(tension));
            }

            Tension = tension;
        }
 /// <summary>
 /// Create a new object to do interpolation, initialized with a given list of data.
 /// </summary>
 /// <param name = "keyPoints">The list of key points to interpolate between.</param>
 protected AbstractInterpolation(AbstractKeyPointCollection <TValue, TMath> keyPoints)
 {
     KeyPoints = keyPoints;
 }
 /// <summary>
 /// Create a new object to do linear interpolation.
 /// </summary>
 /// <param name = "keyPoints">The list of key points to interpolate between.</param>
 public LinearInterpolation(AbstractKeyPointCollection <TValue, TMath> keyPoints)
     : base(keyPoints)
 {
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new object to do cardinal spline interpolation.
 /// </summary>
 /// <param name = "keyPoints">The list of key points to interpolate between.</param>
 public CardinalSplineInterpolation(AbstractKeyPointCollection <TValue, TMath> keyPoints)
     : this(keyPoints, 0.5)
 {
 }