Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NewtonSmoothFractal.cs
1using System;
2using System.Numerics;
3using System.Text;
4using System.Threading.Tasks;
5using SkiaSharp;
12
14{
51 {
57 : base(new ScriptNode[] { z, dr, R, c, Palette, DimX, DimY },
58 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
59 ArgumentType.Normal, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar},
61 {
62 }
63
69 : base(new ScriptNode[] { z, dr, R, c, Palette, DimX },
70 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
71 ArgumentType.Normal, ArgumentType.Vector, ArgumentType.Scalar},
73 {
74 }
75
81 : base(new ScriptNode[] { z, dr, R, c, Palette },
82 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
83 ArgumentType.Normal, ArgumentType.Vector },
85 {
86 }
87
93 : base(new ScriptNode[] { z, dr, R, c },
94 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
95 ArgumentType.Normal },
97 {
98 }
99
103 public override string[] DefaultArgumentNames
104 {
105 get
106 {
107 return new string[] { "z", "dr", "R", "c", "Palette", "DimX", "DimY" };
108 }
109 }
110
115 public override bool IsAsynchronous => true;
116
121 {
122 return this.EvaluateAsync(Arguments, Variables).Result;
123 }
124
128 public override async Task<IElement> EvaluateAsync(IElement[] Arguments, Variables Variables)
129 {
130 string ColorExpression = null;
131 SKColor[] Palette;
132 double[] Coefficients = null;
133 Complex[] CoefficientsZ = null;
134 ILambdaExpression f = null;
135 ScriptNode fDef = null;
136 double rc, ic;
137 double dr;
138 Complex R;
139 int dimx, dimy;
140 int c = Arguments.Length;
141 int i = 0;
142 object Obj;
143
144 Obj = Arguments[i++].AssociatedObjectValue;
145 if (Obj is Complex z)
146 {
147 rc = z.Real;
148 ic = z.Imaginary;
149 }
150 else
151 {
152 rc = Expression.ToDouble(Obj);
153 ic = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
154 }
155
156 if (i >= c)
157 throw new ScriptRuntimeException("Insufficient parameters in call to NewtonSmoothFractal().", this);
158
159 dr = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
160
161 if (i < c && ((Obj = Arguments[i].AssociatedObjectValue) is double || Obj is Complex))
162 {
163 R = Expression.ToComplex(Obj);
164 i++;
165 }
166 else
167 {
168 R = Complex.One;
169
170 if (i < c && this.Arguments[i] is null)
171 i++;
172 }
173
174 if (i < c)
175 {
176 if (Arguments[i] is DoubleVector)
177 Coefficients = (double[])Arguments[i++].AssociatedObjectValue;
178 else if (Arguments[i] is ComplexVector)
179 CoefficientsZ = (Complex[])Arguments[i++].AssociatedObjectValue;
180 /*else if (Parameters[i] is RealPolynomial)
181 Coefficients = ((RealPolynomial)Arguments[i++].AssociatedObjectValue).Coefficients;
182 else if (Parameters[i] is ComplexPolynomial)
183 CoefficientsZ = ((ComplexPolynomial)Arguments[i++].AssociatedObjectValue).Coefficients;*/
184 else if (Arguments[i] is IVector)
185 {
186 IVector Vector = (IVector)Arguments[i++];
187 int j, d = Vector.Dimension;
188
189 CoefficientsZ = new Complex[d];
190 for (j = 0; j < d; j++)
191 CoefficientsZ[j] = Expression.ToComplex(Vector.GetElement(j).AssociatedObjectValue);
192 }
193 else if (Arguments[i].AssociatedObjectValue is ILambdaExpression)
194 {
196 if (f.NrArguments != 1)
197 throw new ScriptRuntimeException("Lambda expression in calls to NewtonSmoothFractal() must be of one variable.", this);
198
199 fDef = this.Arguments[i++];
200 }
201 else
202 {
203 throw new ScriptRuntimeException("Parameter " + (i + 1).ToString() +
204 " in call to NewtonSmoothFractal has to be a vector of numbers, containing coefficients " +
205 "of the polynomial to use. Now it was of type " + Arguments[i].GetType().FullName,
206 this);
207 }
208 }
209 else
210 throw new ScriptRuntimeException("Missing coefficients or lambda expression.", this);
211
212 if (i < c && !(this.Arguments[i] is null) && Arguments[i] is ObjectVector)
213 {
214 ColorExpression = this.Arguments[i].SubExpression;
216 }
217 else
218 {
219 Palette = ColorModels.RandomLinearAnalogousHSL.CreatePalette(128, 4, out int Seed, this, Variables);
220 ColorExpression = "RandomLinearAnalogousHSL(128,4," + Seed.ToString() + ")";
221
222 if (i < c && this.Arguments[i] is null)
223 i++;
224 }
225
226 if (i < c)
227 dimx = (int)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
228 else
229 dimx = 320;
230
231 if (i < c)
232 dimy = (int)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
233 else
234 dimy = 200;
235
236 if (i < c)
237 {
238 throw new ScriptRuntimeException("Parameter mismatch in call to NewtonSmoothFractal(r,c,dr,Coefficients[,Palette][,dimx[,dimy]]).",
239 this);
240 }
241
242 if (dimx <= 0 || dimx > 5000 || dimy <= 0 || dimy > 5000)
243 throw new FractalImageSizeScriptException(this);
244
245 if (!(f is null))
246 {
247 return await CalcNewtonSmooth(rc, ic, dr, R, f, Variables, Palette, dimx, dimy, this, this.FractalZoomScript,
248 new object[] { Palette, dimx, dimy, R, fDef, ColorExpression });
249 }
250 else if (!(CoefficientsZ is null))
251 {
252 return await CalcNewtonSmooth(rc, ic, dr, R, CoefficientsZ, Palette, dimx, dimy,
253 this, Variables, this.FractalZoomScript,
254 new object[] { Palette, dimx, dimy, R, CoefficientsZ, ColorExpression });
255 }
256 else
257 {
258 return await CalcNewtonSmooth(rc, ic, dr, R, Coefficients, Palette, dimx, dimy,
259 this, Variables, this.FractalZoomScript,
260 new object[] { Palette, dimx, dimy, R, Coefficients, ColorExpression });
261 }
262 }
263
264 private string FractalZoomScript(double r, double i, double Size, object State)
265 {
266 object[] Parameters = (object[])State;
267 int DimX = (int)Parameters[1];
268 int DimY = (int)Parameters[2];
269 Complex R = (Complex)Parameters[3];
270 double[] Coefficients = Parameters[4] as double[];
271 string ColorExpression = (string)Parameters[5];
272
273 StringBuilder sb = new StringBuilder();
274
275 sb.Append("NewtonSmoothFractal((");
276 sb.Append(Expression.ToString(r));
277 sb.Append(',');
278 sb.Append(Expression.ToString(i));
279 sb.Append("),");
280 sb.Append(Expression.ToString(Size / 4));
281 sb.Append(',');
282 sb.Append(Expression.ToString(R));
283 sb.Append(',');
284
285 if (Parameters[4] is ScriptNode fDef)
286 sb.Append(fDef.SubExpression);
287 else if (Parameters[4] is Complex[] CoefficientsZ)
288 sb.Append(Expression.ToString(CoefficientsZ));
289 else
290 sb.Append(Expression.ToString(Coefficients));
291
292 if (!string.IsNullOrEmpty(ColorExpression))
293 {
294 sb.Append(',');
295 sb.Append(ColorExpression);
296 }
297
298 sb.Append(',');
299 sb.Append(DimX.ToString());
300 sb.Append(',');
301 sb.Append(DimY.ToString());
302 sb.Append(')');
303
304 return sb.ToString();
305 }
306
310 public static async Task<FractalGraph> CalcNewtonSmooth(double rCenter, double iCenter, double rDelta, Complex R,
311 double[] Coefficients, SKColor[] Palette, int Width, int Height, ScriptNode Node, Variables Variables,
312 FractalZoomScript FractalZoomScript, object State)
313 {
314 double RRe = R.Real;
315 double RIm = R.Imaginary;
316 double r0, i0, r1, i1;
317 double dr, di;
318 double r, i;
319 double zr, zi, zr2, zi2, zr3, zi3, zr4, zi4;
320 double aspect;
321 double Temp;
322 int x, y;
323 int n, N;
324 int Degree = Coefficients.Length - 1;
325
326 N = Palette.Length;
327
328 if (Degree < 2)
329 {
330 Array.Resize(ref Coefficients, 3);
331 while (Degree < 2)
332 Coefficients[++Degree] = 0;
333 }
334
335 if (Width <= 2 || Height <= 2)
336 throw new ScriptRuntimeException("Width and Height has to be greater than 2.", Node);
337
338 double[] Prim = new double[Degree];
339 for (x = 1; x <= Degree; x++)
340 Prim[x - 1] = x * Coefficients[x];
341
342 Array.Reverse(Prim);
343 Coefficients = (double[])Coefficients.Clone();
344 Array.Reverse(Coefficients);
345
346 int Size = Width * Height;
347 double Conv = 1e-10;
348 double Div = 1e10;
349 double[] ColorIndex = new double[Size];
350 int Index = 0;
351
352 rDelta *= 0.5;
353 r0 = rCenter - rDelta;
354 r1 = rCenter + rDelta;
355
356 aspect = ((double)Width) / Height;
357
358 i0 = iCenter - rDelta / aspect;
359 i1 = iCenter + rDelta / aspect;
360
361 dr = (r1 - r0) / Width;
362 di = (i1 - i0) / Height;
363
364 for (y = 0, i = i0; y < Height; y++, i += di)
365 {
366 for (x = 0, r = r0; x < Width; x++, r += dr)
367 {
368 zr = r;
369 zi = i;
370
371 n = 0;
372 do
373 {
374 // f:
375 zr2 = zi2 = 0;
376 foreach (double C in Coefficients)
377 {
378 Temp = zr2 * zr - zi2 * zi + C;
379 zi2 = zr2 * zi + zi2 * zr;
380 zr2 = Temp;
381 }
382
383 // f':
384 zr3 = zi3 = 0;
385 foreach (double C in Prim)
386 {
387 Temp = zr3 * zr - zi3 * zi + C;
388 zi3 = zr3 * zi + zi3 * zr;
389 zr3 = Temp;
390 }
391
392 // f/f':
393
394 Temp = 1.0 / (zr3 * zr3 + zi3 * zi3);
395 zr4 = (zr2 * zr3 + zi2 * zi3) * Temp;
396 zi4 = (zi2 * zr3 - zr2 * zi3) * Temp;
397
398 // R*f/f'
399 Temp = zr4 * RRe - zi4 * RIm;
400 zi4 = zr4 * RIm + zi4 * RRe;
401 zr4 = Temp;
402
403 zr -= zr4;
404 zi -= zi4;
405
406 Temp = Math.Sqrt(zr4 * zr4 + zi4 * zi4);
407 }
408 while ((Temp > Conv) && (Temp < Div) && (n++ < N));
409
410 if (Temp < Conv && n < N)
411 ColorIndex[Index++] = n;
412 else
413 ColorIndex[Index++] = N;
414 }
415 }
416
417 await Variables.Preview(Node.Expression, new GraphBitmap(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette)));
418
419 double[] Boundary = FractalGraph.FindBoundaries(ColorIndex, Width, Height);
420 await FractalGraph.Smooth(ColorIndex, Boundary, Width, Height, N, Palette, Node, Variables);
421
422 return new FractalGraph(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette),
423 r0, i0, r1, i1, rDelta * 2, true, Node, FractalZoomScript, State);
424 }
425
429 public static async Task<FractalGraph> CalcNewtonSmooth(double rCenter, double iCenter, double rDelta, Complex R,
430 Complex[] Coefficients, SKColor[] Palette, int Width, int Height, ScriptNode Node, Variables Variables,
431 FractalZoomScript FractalZoomScript, object State)
432 {
433 double RRe = R.Real;
434 double RIm = R.Imaginary;
435 double r0, i0, r1, i1;
436 double dr, di;
437 double r, i;
438 double zr, zi, zr2, zi2, zr3, zi3, zr4, zi4;
439 double aspect;
440 double Temp;
441 int x, y;
442 int n, N;
443 int Degree = Coefficients.Length - 1;
444
445 N = Palette.Length;
446
447 if (Degree < 2)
448 {
449 Array.Resize(ref Coefficients, 3);
450 while (Degree < 2)
451 Coefficients[++Degree] = Complex.Zero;
452 }
453
454 if (Width <= 2 || Height <= 2)
455 throw new ScriptRuntimeException("Width and Height has to be greater than 2.", Node);
456
457 Complex[] Prim = new Complex[Degree];
458 for (x = 1; x <= Degree; x++)
459 Prim[x - 1] = x * Coefficients[x];
460
461 Array.Reverse(Prim);
462 Coefficients = (Complex[])Coefficients.Clone();
463 Array.Reverse(Coefficients);
464
465 int j, c = Prim.Length;
466 double[] ReC = new double[c + 1];
467 double[] ImC = new double[c + 1];
468 double[] RePrim = new double[c];
469 double[] ImPrim = new double[c];
470 Complex z;
471
472 for (j = 0; j < c; j++)
473 {
474 z = Coefficients[j];
475 ReC[j] = z.Real;
476 ImC[j] = z.Imaginary;
477
478 z = Prim[j];
479 RePrim[j] = z.Real;
480 ImPrim[j] = z.Imaginary;
481 }
482
483 z = Coefficients[j];
484 ReC[j] = z.Real;
485 ImC[j] = z.Imaginary;
486
487 int Size = Width * Height;
488 double Conv = 1e-10;
489 double Div = 1e10;
490 double[] ColorIndex = new double[Size];
491 int Index = 0;
492
493 rDelta *= 0.5;
494 r0 = rCenter - rDelta;
495 r1 = rCenter + rDelta;
496
497 aspect = ((double)Width) / Height;
498
499 i0 = iCenter - rDelta / aspect;
500 i1 = iCenter + rDelta / aspect;
501
502 dr = (r1 - r0) / Width;
503 di = (i1 - i0) / Height;
504
505 for (y = 0, i = i0; y < Height; y++, i += di)
506 {
507 for (x = 0, r = r0; x < Width; x++, r += dr)
508 {
509 zr = r;
510 zi = i;
511
512 n = 0;
513 do
514 {
515 // f:
516 zr2 = zi2 = 0;
517 for (j = 0; j <= c; j++)
518 {
519 Temp = zr2 * zr - zi2 * zi + ReC[j];
520 zi2 = zr2 * zi + zi2 * zr + ImC[j];
521 zr2 = Temp;
522 }
523
524 // f':
525 zr3 = zi3 = 0;
526 for (j = 0; j < c; j++)
527 {
528 Temp = zr3 * zr - zi3 * zi + RePrim[j];
529 zi3 = zr3 * zi + zi3 * zr + ImPrim[j];
530 zr3 = Temp;
531 }
532
533 // f/f':
534
535 Temp = 1.0 / (zr3 * zr3 + zi3 * zi3);
536 zr4 = (zr2 * zr3 + zi2 * zi3) * Temp;
537 zi4 = (zi2 * zr3 - zr2 * zi3) * Temp;
538
539 // R*f/f'
540 Temp = zr4 * RRe - zi4 * RIm;
541 zi4 = zr4 * RIm + zi4 * RRe;
542 zr4 = Temp;
543
544 zr -= zr4;
545 zi -= zi4;
546
547 Temp = Math.Sqrt(zr4 * zr4 + zi4 * zi4);
548 }
549 while ((Temp > Conv) && (Temp < Div) && (n++ < N));
550
551 if (Temp < Conv && n < N)
552 ColorIndex[Index++] = n;
553 else
554 ColorIndex[Index++] = N;
555 }
556 }
557
558 await Variables.Preview(Node.Expression, new GraphBitmap(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette)));
559
560 double[] Boundary = FractalGraph.FindBoundaries(ColorIndex, Width, Height);
561 await FractalGraph.Smooth(ColorIndex, Boundary, Width, Height, N, Palette, Node, Variables);
562
563 return new FractalGraph(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette),
564 r0, i0, r1, i1, rDelta * 2, true, Node, FractalZoomScript, State);
565 }
566
570 public static async Task<FractalGraph> CalcNewtonSmooth(double rCenter, double iCenter, double rDelta, Complex R,
571 ILambdaExpression f, Variables Variables, SKColor[] Palette, int Width, int Height,
572 ScriptNode Node, FractalZoomScript FractalZoomScript, object State)
573 {
574 double RRe = R.Real;
575 double RIm = R.Imaginary;
576 double r0, i0, r1, i1;
577 double dr, di;
578 double r, i;
579 double aspect;
580 int x, y;
581 int n, N;
582
583 N = Palette.Length;
584
585 if (Width <= 2 || Height <= 2)
586 throw new ScriptRuntimeException("Width and Height has to be greater than 2.", Node);
587
588 Variables v = new Variables();
589 Variables.CopyTo(v);
590
591 if (!(f is IDifferentiable Differentiable) ||
592 !(Differentiable.Differentiate(Differentiable.DefaultVariableName, v) is ILambdaExpression fPrim))
593 {
594 throw new ScriptRuntimeException("Lambda expression not differentiable.", Node);
595 }
596
597 int Size = Width * Height;
598 double Conv = 1e-10;
599 double Div = 1e10;
600 double[] ColorIndex = new double[Size];
601 int Index = 0;
602
603 Complex[] Row;
604 Complex[] Row2;
605 Complex[] Row3;
606 int[] Offset;
607 IElement[] P = new IElement[1];
608 int j, c, x2;
609 IElement Obj, Obj2;
610 double Mod;
611 Complex z;
612
613 rDelta *= 0.5;
614 r0 = rCenter - rDelta;
615 r1 = rCenter + rDelta;
616
617 aspect = ((double)Width) / Height;
618
619 i0 = iCenter - rDelta / aspect;
620 i1 = iCenter + rDelta / aspect;
621
622 dr = (r1 - r0) / Width;
623 di = (i1 - i0) / Height;
624
625 for (y = 0, i = i0; y < Height; y++, i += di)
626 {
627 Row = new Complex[Width];
628 Offset = new int[Width];
629
630 c = Width;
631 for (x = 0, x2 = y * Width, r = r0; x < Width; x++, r += dr, x2++)
632 {
633 Row[x] = new Complex(r, i);
634 Offset[x] = x2;
635 }
636
637 n = 0;
638 while (n < N && c > 0)
639 {
640 n++;
641 P[0] = new ComplexVector(Row);
642 Obj = f.Evaluate(P, v);
643 Obj2 = fPrim.Evaluate(P, v);
644 Row2 = Obj.AssociatedObjectValue as Complex[];
645 Row3 = Obj2.AssociatedObjectValue as Complex[];
646
647 if (Row2 is null || Row3 is null)
648 {
649 throw new ScriptRuntimeException("Lambda expression (and its first derivative) must be able to accept complex vectors, " +
650 "and return complex vectors of equal length. Type returned: " +
651 Obj.GetType().FullName + " and " + Obj2.GetType().FullName, Node);
652 }
653 else if (Row2.Length != c || Row3.Length != c)
654 {
655 throw new ScriptRuntimeException("Lambda expression (and its first derivative) must be able to accept complex vectors, " +
656 "and return complex vectors of equal length. Length returned: " +
657 Row2.Length.ToString() + " and " + Row3.Length.ToString() +
658 ". Expected: " + c.ToString(), Node);
659 }
660
661 for (x = x2 = 0; x < c; x++)
662 {
663 j = Offset[x];
664 z = R * Row2[x] / Row3[x];
665 Row[x] -= z;
666
667 Mod = z.Magnitude;
668
669 if (Mod > Conv && Mod < Div)
670 {
671 if (x != x2)
672 Offset[x2] = j;
673
674 x2++;
675 }
676 else
677 {
678 if (n >= N)
679 ColorIndex[Index++] = N;
680 else
681 ColorIndex[j++] = n;
682 }
683 }
684
685 if (x2 < x)
686 {
687 Array.Resize(ref Row, x2);
688 Array.Resize(ref Offset, x2);
689 c = x2;
690 }
691 }
692 }
693
694 await Variables.Preview(Node.Expression, new GraphBitmap(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette)));
695
696 double[] Boundary = FractalGraph.FindBoundaries(ColorIndex, Width, Height);
697 await FractalGraph.Smooth(ColorIndex, Boundary, Width, Height, N, Palette, Node, Variables);
698
699 return new FractalGraph(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette),
700 r0, i0, r1, i1, rDelta * 2, true, Node, FractalZoomScript, State);
701 }
702
706 public override string FunctionName => nameof(NewtonSmoothFractal);
707 }
708}
Class managing a script expression.
Definition: Expression.cs:41
static Complex ToComplex(object Object)
Converts an object to a complex value.
Definition: Expression.cs:5228
static double ToDouble(object Object)
Converts an object to a double value.
Definition: Expression.cs:5110
static string ToString(double Value)
Converts a value to a string, that can be parsed as part of an expression.
Definition: Expression.cs:4760
Calculates a Newton Fractal Image, and smoothes the colors using the heat equation in two spatial dim...
NewtonSmoothFractal(ScriptNode z, ScriptNode dr, ScriptNode R, ScriptNode c, ScriptNode Palette, ScriptNode DimX, int Start, int Length, Expression Expression)
TODO
static async Task< FractalGraph > CalcNewtonSmooth(double rCenter, double iCenter, double rDelta, Complex R, Complex[] Coefficients, SKColor[] Palette, int Width, int Height, ScriptNode Node, Variables Variables, FractalZoomScript FractalZoomScript, object State)
TODO
NewtonSmoothFractal(ScriptNode z, ScriptNode dr, ScriptNode R, ScriptNode c, int Start, int Length, Expression Expression)
TODO
override IElement Evaluate(IElement[] Arguments, Variables Variables)
TODO
static async Task< FractalGraph > CalcNewtonSmooth(double rCenter, double iCenter, double rDelta, Complex R, ILambdaExpression f, Variables Variables, SKColor[] Palette, int Width, int Height, ScriptNode Node, FractalZoomScript FractalZoomScript, object State)
TODO
static async Task< FractalGraph > CalcNewtonSmooth(double rCenter, double iCenter, double rDelta, Complex R, double[] Coefficients, SKColor[] Palette, int Width, int Height, ScriptNode Node, Variables Variables, FractalZoomScript FractalZoomScript, object State)
TODO
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
NewtonSmoothFractal(ScriptNode z, ScriptNode dr, ScriptNode R, ScriptNode c, ScriptNode Palette, ScriptNode DimX, ScriptNode DimY, int Start, int Length, Expression Expression)
TODO
override async Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
TODO
NewtonSmoothFractal(ScriptNode z, ScriptNode dr, ScriptNode R, ScriptNode c, ScriptNode Palette, int Start, int Length, Expression Expression)
TODO
Exception thrown if an image with invalid size is requested.
Defines a clickable fractal graph in the complex plane.
Definition: FractalGraph.cs:23
static async Task Smooth(double[] ColorIndex, double[] Boundary, int Width, int Height, int N, SKColor[] Palette, ScriptNode Node, Variables Variables)
TODO
static PixelInformation ToPixels(double[] ColorIndex, int Width, int Height, SKColor[] Palette)
TODO
static SKColor[] ToPalette(ObjectVector Vector)
TODO
static double[] FindBoundaries(double[] ColorIndex, int Width, int Height)
TODO
Handles bitmap-based graphs.
Definition: GraphBitmap.cs:13
Base class for multivariate funcions.
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
override string ToString()
Definition: ScriptNode.cs:359
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
void CopyTo(Variables Variables)
Copies available variables to another variable collection.
Definition: Variables.cs:334
async Task Preview(Expression Expression, IElement Result)
Reports a preview of the final result.
Definition: Variables.cs:407
Basic interface for all types of elements.
Definition: IElement.cs:21
object AssociatedObjectValue
Associated object value.
Definition: IElement.cs:34
Basic interface for vectors.
Definition: IVector.cs:9
int Dimension
Dimension of vector.
Definition: IVector.cs:14
IElement GetElement(int Index)
Gets an element of the vector.
Base interface for lambda expressions.
Base interface for lambda expressions.
IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the lambda expression.
delegate string FractalZoomScript(double r, double i, double Size, object State)
Generates new script when zoomed.
ArgumentType
Type of parameter used in a function definition or a lambda definition.
Definition: IFunction.cs:9