public BaseOperator(IEquation x, IEquation y, Func _fn, string _symbol) { LHS = x; RHS = y; fn = _fn; symbol = _symbol; }
public Point[] Calculate(IEquation e, double start, double end) { List<Point> results = new List<Point>(); equation ef = e.f; CalculateZeros cs = new CalculateZeros(ef); cs.FindZerosInRange(start, end); results = cs.Zeros; return results.ToArray(); }
public MultiplyOperation(IEquation x, IEquation y) : base(x, y, (a, b) => a * b, "x") { }
public MinusOperation(IEquation x, IEquation y) : base(x, y, (a, b) => a - b, "-") { }
public DivideOperation(IEquation x, IEquation y) : base(x, y, (a, b) => a / b, "/") { }
public AddOperation(IEquation x, IEquation y) : base(x, y, (a,b) => a + b, "+") { }
public CalculateValues(IEquation _myFunc) { segmentWidth = 0.01d; values = new List<Point>(); myFunc = _myFunc; }
protected void ParseEquation(string equation) { equation = CheckForEvenOdd(equation); formula = Equations.CreateEquation<int>(equation); if (!ParsedEquationCache.TryGetValue(equation, out cacheInfo)) { cacheInfo = new CacheInfo(); cacheInfo.MatchingIndices = new HashSet<int>(); ParsedEquationCache[equation] = cacheInfo; } }
/// <summary> /// Parse the equation text into in IEquation, or obtain from the cache if available /// </summary> /// <param name="equationText"></param> protected void ParseEquation(string equationText) { CheckForSimpleNumber(equationText); if (IsJustNumber) { return; } equationText = CheckForEvenOdd(equationText); if (!ParsedEquationCache.TryGetValue(equationText, out cacheInfo)) { cacheInfo = new CacheInfo(); Equation = cacheInfo.Equation = GetEquation(equationText); ParsedEquationCache.TryAdd(equationText, cacheInfo); } else { Equation = cacheInfo.Equation; } }
//================================================================ //Getter and Setter //================================================================ public void Equation(IEquation equation) { this.equation = equation; }
internal Function1P(Func <float, float> function, IEquation x0, Func <float, Action <string>, bool> validityChecker = null) { this.function = function; this.x0 = x0; this.validityChecker = validityChecker; }
public MandelbrotSet(IEquation equationIn) : this() { myEquation = equationIn; }
public void SetEquation(IEquation eq) { Equation = eq; Debug.Log("Changed equation"); }
void Start() { Equation = new SinusEquation(); Transform = GetComponent <Transform>(); Origin = transform.position; }
internal Equation(IEquation equation) { this.equation = equation; }
internal LambdaFunction(Func <float, float, float> function, IEquation s, IEquation d, IEquation i, IEquation eq) { this.function = function; this.s = s; this.d = d; this.i = i; this.eq = eq; }