Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RectanglesVariation.cs
1using System;
4
6{
11 {
12 private readonly double x;
13 private readonly double y;
14
19 : base(new ScriptNode[] { x, y }, new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar },
21 {
22 this.x = 0;
23 this.y = 0;
24 }
25
26 private RectanglesVariation(double X, double Y, ScriptNode x, ScriptNode y, int Start, int Length,
28 : base(new ScriptNode[] { x, y }, new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar },
30 {
31 this.x = X;
32 this.y = Y;
33 }
34
38 public override string[] DefaultArgumentNames
39 {
40 get
41 {
42 return new string[] { "x", "y" };
43 }
44 }
45
50 {
53
54 return new RectanglesVariation(X, Y, this.Arguments[0], this.Arguments[1], this.Start, this.Length, this.Expression);
55 }
56
60 public override void Operate(ref double x, ref double y)
61 {
62 x = (2 * Math.Floor(x / this.x) + 1) * this.x - x;
63 y = (2 * Math.Floor(y / this.y) + 1) * this.y - y;
64 }
65
69 public override string FunctionName => nameof(RectanglesVariation);
70 }
71}
Class managing a script expression.
Definition: Expression.cs:39
static double ToDouble(object Object)
Converts an object to a double value.
Definition: Expression.cs:4824
override void Operate(ref double x, ref double y)
TODO
override IElement Evaluate(IElement[] Arguments, Variables Variables)
TODO
RectanglesVariation(ScriptNode x, ScriptNode y, int Start, int Length, Expression Expression)
TODO
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
ArgumentType
Type of parameter used in a function definition or a lambda definition.
Definition: IFunction.cs:9