/// <summary> /// Creates a bidimensional mesh matrix. /// </summary> /// public static double[][] Mesh(DoubleRange rowRange, DoubleRange colRange, double rowSteps, double colSteps) { double[][] mesh = Matrix.CartesianProduct( Matrix.Interval(rowRange, rowSteps), Matrix.Interval(colRange, colSteps)); return(mesh); }
/// <summary> /// Creates a bi-dimensional mesh matrix. /// </summary> /// /// <example> /// <code> /// // The Mesh method can be used to generate all /// // possible (x,y) pairs between two ranges. /// /// // We can create a grid as /// double[][] grid = Matrix.Mesh /// ( /// rowMin: 0, rowMax: 1, rowSteps: 10, /// colMin: 0, colMax: 1, colSteps: 5 /// ); /// /// // Now we can plot the points on-screen /// ScatterplotBox.Show("Grid (fixed steps)", grid).Hold(); /// </code> /// /// <para> /// The resulting image is shown below. </para> /// <img src="..\images\grid-fixed-steps.png" /> /// </example> /// public static double[][] Mesh( double rowMin, double rowMax, int rowSteps, double colMin, double colMax, int colSteps) { double[][] mesh = Matrix.CartesianProduct( Matrix.Interval(rowMin, rowMax, rowSteps), Matrix.Interval(colMin, colMax, colSteps)); return(mesh); }
/// <summary> /// Creates a bi-dimensional mesh matrix. /// </summary> /// public static int[][] Mesh( int rowMin, int rowMax, int colMin, int colMax) { int[][] mesh = Matrix.CartesianProduct( Matrix.Interval(rowMin, rowMax), Matrix.Interval(colMin, colMax)); return(mesh); }