Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ParabolaVariation.cs
1using System;
4
6{
11 {
12 private readonly double width;
13 private readonly double height;
14
19 : base(new ScriptNode[] { width, height }, new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar },
21 {
22 this.width = 0;
23 this.height = 0;
24 }
25
29 public ParabolaVariation(double Width, double Height, ScriptNode width, ScriptNode height, int Start, int Length, Expression Expression)
30 : base(new ScriptNode[] { width, height }, new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar },
32 {
33 this.width = Width;
34 this.height = Height;
35 }
36
40 public override string[] DefaultArgumentNames
41 {
42 get
43 {
44 return new string[] { "width", "height" };
45 }
46 }
47
52 {
55
56 return new ParabolaVariation(Width, Height, this.Arguments[0], this.Arguments[1], this.Start, this.Length, this.Expression);
57 }
58
62 public override void Operate(ref double x, ref double y)
63 {
64 double r1;
65
66 lock (this.gen)
67 {
68 r1 = this.gen.NextDouble();
69 }
70
71 double r = Math.Sqrt(x * x + y * y);
72 double s = Math.Sin(r);
73 double c = Math.Cos(r);
74 x = this.height * s * s * r1;
75 y = this.width * c * r1;
76 }
77
78 private readonly Random gen = new Random();
79
83 public override string FunctionName => nameof(ParabolaVariation);
84 }
85}
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
ParabolaVariation(ScriptNode width, ScriptNode height, int Start, int Length, Expression Expression)
TODO
ParabolaVariation(double Width, double Height, ScriptNode width, ScriptNode height, 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