YAMP.Plot2DValue.AddPoints C# (CSharp) Method

AddPoints() public method

Adds points given by a matrix. Vector ? x Values will be generated Matrix ? Investigates which dimension is bigger and takes the larger one as values, the lighter one as series. In a matrix the first series is always excluded and represents the x values.
public AddPoints ( MatrixValue m ) : void
m MatrixValue The matrix with the (multiple) series.
return void
        public override void AddPoints(MatrixValue m)
        {
            if (m.DimensionY == 0 || m.DimensionX == 0)
                return;

            if (m.IsVector)
            {
                var x = Generate(1.0, 1.0, m.Length);
                var y = Convert(m, 0, m.Length);
                AddValues(x, y);
            }
            else if(m.DimensionX <= m.DimensionY)
            {
                var x = ConvertY(m, 0, m.DimensionY, 0);

                for (var k = 2; k <= m.DimensionX; k++)
                {
                    var y = ConvertY(m, 0, m.DimensionY, k - 1);
                    AddValues(x, y);
                }
            }
            else
            {
                var x = ConvertX(m, 0, m.DimensionX, 0);

                for (var k = 2; k <= m.DimensionY; k++)
                {
                    var y = ConvertX(m, 0, m.DimensionX, k - 1);
                    AddValues(x, y);
                }
            }
        }

Same methods

Plot2DValue::AddPoints ( MatrixValue x, MatrixValue y ) : void

Usage Example

Example #1
0
        public Plot2DValue Function(MatrixValue m, MatrixValue n)
        {
            var plot = new Plot2DValue();

            plot.AddPoints(m, n);
            return(plot);
        }
All Usage Examples Of YAMP.Plot2DValue::AddPoints