public ContourPlotValue Function(MatrixValue X, MatrixValue Y, MatrixValue Z) { var plot = new ContourPlotValue(); plot.AddPoints(X, Y, Z); return(plot); }
public ContourPlotValue Function(MatrixValue Z, MatrixValue v) { var plot = new ContourPlotValue(); plot.AddPoints(Z); plot.SetLevels(v); return(plot); }
public ContourPlotValue Function(MatrixValue X, MatrixValue Y, MatrixValue Z, ScalarValue n) { var nn = n.GetIntegerOrThrowException("n", Name); var plot = new ContourPlotValue(); plot.AddPoints(X, Y, Z); plot.SetLevels(nn); return(plot); }
/// <summary> /// Converts a set of bytes to a new instance. /// </summary> /// <param name="content">The binary representation.</param> /// <returns>The new instance.</returns> public override Value Deserialize(byte[] content) { var cp = new ContourPlotValue(); using (var ds = Deserializer.Create(content)) { cp.Deserialize(ds); cp.ColorPalette = (ColorPalettes)ds.GetInt(); cp.ShowLevel = ds.GetBoolean(); cp.Levels = new double[ds.GetInt()]; for (var i = 0; i < Levels.Length; i++) { Levels[i] = ds.GetDouble(); } var length = ds.GetInt(); for (var i = 0; i < length; i++) { var points = new Points <ContourPoint>(); points.Deserialize(ds); var count = ds.GetInt(); for (int j = 0; j < count; j++) { var x = ds.GetDouble(); var y = ds.GetDouble(); var z = ds.GetDouble(); points.Add(new ContourPoint { X = x, Y = y, Magnitude = z }); } cp.AddSeries(points); } } return(cp); }
/// <summary> /// Converts a set of bytes to a new instance. /// </summary> /// <param name="content">The binary representation.</param> /// <returns>The new instance.</returns> public override Value Deserialize(byte[] content) { var cp = new ContourPlotValue(); using (var ds = Deserializer.Create(content)) { cp.Deserialize(ds); cp.ColorPalette = (ColorPalettes)ds.GetInt(); cp.ShowLevel = ds.GetBoolean(); cp.Levels = new double[ds.GetInt()]; for (var i = 0; i < Levels.Length; i++) Levels[i] = ds.GetDouble(); var length = ds.GetInt(); for (var i = 0; i < length; i++) { var points = new Points<ContourPoint>(); points.Deserialize(ds); var count = ds.GetInt(); for (int j = 0; j < count; j++) { var x = ds.GetDouble(); var y = ds.GetDouble(); var z = ds.GetDouble(); points.Add(new ContourPoint { X = x, Y = y, Magnitude = z }); } cp.AddSeries(points); } } return cp; }