Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PerspectiveVariation.cs
1using System;
4
6{
11 {
12 private readonly double angle;
13 private readonly double distance;
14
19 : base(new ScriptNode[] { angle, distance }, new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar },
21 {
22 this.angle = 0;
23 this.distance = 0;
24 }
25
29 public PerspectiveVariation(double Angle, double Distance, ScriptNode angle, ScriptNode distance, int Start, int Length, Expression Expression)
30 : base(new ScriptNode[] { angle, distance }, new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar },
32 {
33 this.angle = Angle;
34 this.distance = Distance;
35 }
36
40 public override string[] DefaultArgumentNames
41 {
42 get
43 {
44 return new string[] { "angle", "distance" };
45 }
46 }
47
52 {
55
56 return new PerspectiveVariation(Angle, Distance, 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 d = this.distance / (this.distance - y * Math.Sin(this.angle));
65 x *= d;
66 y *= d * Math.Cos(this.angle);
67 }
68
72 public override string FunctionName => nameof(PerspectiveVariation);
73 }
74}
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
PerspectiveVariation(ScriptNode angle, ScriptNode distance, int Start, int Length, Expression Expression)
TODO
override void Operate(ref double x, ref double y)
TODO
PerspectiveVariation(double Angle, double Distance, ScriptNode angle, ScriptNode distance, int Start, int Length, Expression Expression)
TODO
override IElement Evaluate(IElement[] Arguments, Variables Variables)
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