Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DegToRad.cs
1using System;
6
8{
13 {
14 private const double scale = Math.PI / 180;
15
25 {
26 }
27
33 public override IElement Evaluate(double Operand)
34 {
35 return new DoubleNumber(Operand * scale);
36 }
37
44 public ScriptNode Differentiate(string VariableName, Variables Variables)
45 {
46 if (this.op is IDifferentiable Differentiable)
47 {
48 return new DegToRad(
49 Differentiable.Differentiate(VariableName, Variables),
50 this.Start, this.Length, this.Expression);
51 }
52 else
53 throw new ScriptRuntimeException("Operand not differentiable.", this);
54 }
55 }
56}
Class managing a script expression.
Definition: Expression.cs:39
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
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Base class for unary double operators.
Degrees to radians operator.
Definition: DegToRad.cs:13
override IElement Evaluate(double Operand)
Evaluates the double operator.
Definition: DegToRad.cs:33
ScriptNode Differentiate(string VariableName, Variables Variables)
Differentiates a script node, if possible.
Definition: DegToRad.cs:44
DegToRad(ScriptNode Operand, int Start, int Length, Expression Expression)
Degrees to radians operator.
Definition: DegToRad.cs:23
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20
Base interface for lambda expressions.