YAMP.PlotValue.MakeArrayPeriodic C# (CSharp) Method

MakeArrayPeriodic() protected method

Increases the size of an array to n elements, repeating the containing elements.
protected MakeArrayPeriodic ( Double values, Int32 n ) : Double[]
values Double The current array.
n System.Int32 The desired size of the array.
return Double[]
        protected Double[] MakeArrayPeriodic(Double[] values, Int32 n)
        {
            var dest = new Double[n];

            if (values.Length > 0)
            {
                for (var i = 0; i < n; i++)
                {
                    dest[i] = values[i % values.Length];
                }
            }

            return dest;
        }