Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
VerticalBars3D.cs
1using System;
6
8{
13 {
24 : base(new ScriptNode[] { X, Y, Z },
25 new ArgumentType[] { ArgumentType.Matrix, ArgumentType.Matrix, ArgumentType.Matrix },
27 {
28 }
29
41 : base(new ScriptNode[] { X, Y, Z, Color },
42 new ArgumentType[] { ArgumentType.Matrix, ArgumentType.Matrix, ArgumentType.Matrix, ArgumentType.Scalar },
44 {
45 }
46
50 public override string FunctionName => nameof(VerticalBars3D);
51
55 public override string[] DefaultArgumentNames
56 {
57 get { return new string[] { "x", "y", "z", "color", "twoSided" }; }
58 }
59
67 {
68 if (!(Arguments[0] is IMatrix X))
69 throw new ScriptRuntimeException("Expected matrix for X argument.", this);
70
71 if (!(Arguments[1] is IMatrix Y))
72 throw new ScriptRuntimeException("Expected matrix for Y argument.", this);
73
74 if (!(Arguments[2] is IMatrix Z))
75 throw new ScriptRuntimeException("Expected matrix for Z argument.", this);
76
77 int Rows = X.Rows;
78 int Columns = X.Columns;
79 if (Y.Rows != Rows || Y.Columns != Columns || Z.Rows != Rows || Z.Columns != Columns)
80 throw new ScriptRuntimeException("Matrix dimension mismatch.", this);
81
82 IElement Color = Arguments.Length <= 3 ? null : Arguments[3];
83
84 return new Graph3D(Variables, X, Y, Z, null, new VerticalBars3DPainter(), false, true, false, this,
85 Color?.AssociatedObjectValue ?? Graph.DefaultColor);
86 }
87 }
88}
Class managing a script expression.
Definition: Expression.cs:39
Plots a three-dimensional vertical bars chart.
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
VerticalBars3D(ScriptNode X, ScriptNode Y, ScriptNode Z, int Start, int Length, Expression Expression)
Plots a three-dimensional vertical bars chart.
override string FunctionName
Name of the function
VerticalBars3D(ScriptNode X, ScriptNode Y, ScriptNode Z, ScriptNode Color, int Start, int Length, Expression Expression)
Plots a three-dimensional surface.
override string[] DefaultArgumentNames
Default Argument names
Plots a three-dimensional vertical bars chart.
Handles three-dimensional graphs.
Definition: Graph3D.cs:28
Base class for graphs.
Definition: Graph.cs:79
static readonly SKColor DefaultColor
Default color: Red
Definition: Graph.cs:118
Base class for multivariate funcions.
ScriptNode[] Arguments
Function arguments.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
Expression Expression
Expression of which the node is a part.
Definition: ScriptNode.cs:177
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20
Basic interface for matrices.
Definition: IMatrix.cs:9
ArgumentType
Type of parameter used in a function definition or a lambda definition.
Definition: IFunction.cs:9