Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
HalleyTopographyFractal.cs
1using System;
2using System.Numerics;
3using System.Text;
4using SkiaSharp;
9
11{
40 {
45 ScriptNode Palette, ScriptNode DimX, ScriptNode DimY, int Start, int Length, Expression Expression)
46 : base(new ScriptNode[] { z, dr, R, Coefficients, Palette, DimX, DimY },
47 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
48 ArgumentType.Normal, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar}, Start, Length, Expression)
49 {
50 }
51
56 ScriptNode Palette, ScriptNode DimX, int Start, int Length, Expression Expression)
57 : base(new ScriptNode[] { z, dr, R, Coefficients, Palette, DimX },
58 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
60 {
61 }
62
67 ScriptNode Palette, int Start, int Length, Expression Expression)
68 : base(new ScriptNode[] { z, dr, R, Coefficients, Palette },
69 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
71 {
72 }
73
79 : base(new ScriptNode[] { z, dr, R, Coefficients },
80 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
82 {
83 }
84
89 : base(new ScriptNode[] { z, dr, R },
90 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar }, Start, Length, Expression)
91 {
92 }
93
98 : base(new ScriptNode[] { z, dr },
99 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar }, Start, Length, Expression)
100 {
101 }
102
106 public override string[] DefaultArgumentNames
107 {
108 get
109 {
110 return new string[] { "z", "dr", "R", "Coefficients", "Palette", "DimX", "DimY" };
111 }
112 }
113
118 {
119 string ColorExpression = null;
120 SKColor[] Palette;
121 double[] Coefficients = null;
122 Complex[] CoefficientsZ = null;
123 ILambdaExpression f = null;
124 ScriptNode fDef = null;
125 double rc, ic;
126 double dr;
127 Complex R;
128 int dimx, dimy;
129 int c = Arguments.Length;
130 int i = 0;
131 object Obj;
132
133 Obj = Arguments[i++].AssociatedObjectValue;
134 if (Obj is Complex z)
135 {
136 rc = z.Real;
137 ic = z.Imaginary;
138 }
139 else
140 {
141 rc = Expression.ToDouble(Obj);
142 ic = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
143 }
144
145 if (i >= c)
146 throw new ScriptRuntimeException("Insufficient parameters in call to HalleyTopographyFractal().", this);
147
148 dr = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
149
150 if (i < c && ((Obj = Arguments[i].AssociatedObjectValue) is double || Obj is Complex))
151 {
152 R = Expression.ToComplex(Obj);
153 i++;
154 }
155 else
156 {
157 R = Complex.One;
158
159 if (i < c && this.Arguments[i] is null)
160 i++;
161 }
162
163 if (i < c)
164 {
165 if (Arguments[i] is DoubleVector)
166 Coefficients = (double[])Arguments[i++].AssociatedObjectValue;
167 else if (Arguments[i] is ComplexVector)
168 CoefficientsZ = (Complex[])Arguments[i++].AssociatedObjectValue;
169 /*else if (Parameters[i] is RealPolynomial)
170 Coefficients = ((RealPolynomial)Arguments[i++].AssociatedObjectValue).Coefficients;
171 else if (Parameters[i] is ComplexPolynomial)
172 CoefficientsZ = ((ComplexPolynomial)Arguments[i++].AssociatedObjectValue).Coefficients;*/
173 else if (Arguments[i] is IVector)
174 {
175 IVector Vector = (IVector)Arguments[i++];
176 int j, d = Vector.Dimension;
177
178 CoefficientsZ = new Complex[d];
179 for (j = 0; j < d; j++)
180 CoefficientsZ[j] = Expression.ToComplex(Vector.GetElement(j).AssociatedObjectValue);
181 }
182 else if (Arguments[i].AssociatedObjectValue is ILambdaExpression)
183 {
185 if (f.NrArguments != 1)
186 throw new ScriptRuntimeException("Lambda expression in calls to HalleyTopographyFractal() must be of one variable.", this);
187
188 fDef = this.Arguments[i++];
189 }
190 else
191 {
192 throw new ScriptRuntimeException("Parameter " + (i + 1).ToString() +
193 " in call to HalleyTopographyFractal has to be a vector of numbers, containing coefficients " +
194 "of the polynomial to use. Now it was of type " + Arguments[i].GetType().FullName,
195 this);
196 }
197 }
198 else
199 throw new ScriptRuntimeException("Missing coefficients or lambda expression.", this);
200
201 if (i < c && !(this.Arguments[i] is null) && Arguments[i] is ObjectVector)
202 {
203 ColorExpression = this.Arguments[i].SubExpression;
205 }
206 else
207 {
208 Palette = ColorModels.RandomLinearAnalogousHSL.CreatePalette(128, 4, out int Seed, this, Variables);
209 ColorExpression = "RandomLinearAnalogousHSL(128,4," + Seed.ToString() + ")";
210
211 if (i < c && this.Arguments[i] is null)
212 i++;
213 }
214
215 if (i < c)
216 dimx = (int)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
217 else
218 dimx = 320;
219
220 if (i < c)
221 dimy = (int)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
222 else
223 dimy = 200;
224
225 if (i < c)
226 {
227 throw new ScriptRuntimeException("Parameter mismatch in call to HalleyTopographyFractal(z,dr[,R][,Coefficients][,Palette][,dimx[,dimy]]).",
228 this);
229 }
230
231 if (dimx <= 0 || dimx > 5000 || dimy <= 0 || dimy > 5000)
232 throw new ScriptRuntimeException("Image size must be within 1x1 to 5000x5000", this);
233
234 if (!(f is null))
235 {
236 return CalcHalley(rc, ic, dr, R, f, Variables, Palette, dimx, dimy, this, this.FractalZoomScript,
237 new object[] { Palette, dimx, dimy, R, fDef, ColorExpression });
238 }
239 else if (!(CoefficientsZ is null))
240 {
241 return CalcHalley(Variables, rc, ic, dr, R, CoefficientsZ, Palette, dimx, dimy,
242 this, this.FractalZoomScript,
243 new object[] { Palette, dimx, dimy, R, CoefficientsZ, ColorExpression });
244 }
245 else
246 {
247 return CalcHalley(Variables, rc, ic, dr, R, Coefficients, Palette, dimx, dimy,
248 this, this.FractalZoomScript,
249 new object[] { Palette, dimx, dimy, R, Coefficients, ColorExpression });
250 }
251 }
252
253 private string FractalZoomScript(double r, double i, double Size, object State)
254 {
255 object[] Parameters = (object[])State;
256 int DimX = (int)Parameters[1];
257 int DimY = (int)Parameters[2];
258 Complex R = (Complex)Parameters[3];
259 double[] Coefficients = Parameters[4] as double[];
260 string ColorExpression = (string)Parameters[5];
261
262 StringBuilder sb = new StringBuilder();
263
264 sb.Append("HalleyTopographyFractal((");
265 sb.Append(Expression.ToString(r));
266 sb.Append(',');
267 sb.Append(Expression.ToString(i));
268 sb.Append("),");
269 sb.Append(Expression.ToString(Size / 4));
270 sb.Append(',');
271 sb.Append(Expression.ToString(R));
272 sb.Append(',');
273
274 if (Parameters[4] is ScriptNode fDef)
275 sb.Append(fDef.SubExpression);
276 else if (Parameters[4] is Complex[] CoefficientsZ)
277 sb.Append(Expression.ToString(CoefficientsZ));
278 else
279 sb.Append(Expression.ToString(Coefficients));
280
281 if (!string.IsNullOrEmpty(ColorExpression))
282 {
283 sb.Append(',');
284 sb.Append(ColorExpression);
285 }
286
287 sb.Append(',');
288 sb.Append(DimX.ToString());
289 sb.Append(',');
290 sb.Append(DimY.ToString());
291 sb.Append(')');
292
293 return sb.ToString();
294 }
295
299 public static FractalGraph CalcHalley(Variables Variables, double rCenter, double iCenter, double rDelta, Complex R,
300 double[] Coefficients, SKColor[] Palette, int Width, int Height, ScriptNode Node,
301 FractalZoomScript FractalZoomScript, object State)
302 {
303 double RRe = R.Real;
304 double RIm = R.Imaginary;
305 double r0, i0, r1, i1;
306 double dr, di;
307 double r, i;
308 double zr, zi, zr2, zi2, zr3, zi3, zr4, zi4, zr5, zi5, zr6, zi6;
309 double aspect;
310 double Temp;
311 int x, y;
312 int n, N;
313 int index;
314 int Degree = Coefficients.Length - 1;
315
316 N = Palette.Length;
317
318 if (Degree < 3)
319 {
320 Array.Resize(ref Coefficients, 4);
321 while (Degree < 3)
322 Coefficients[++Degree] = 0;
323 }
324
325 double[] Prim = new double[Degree];
326 for (x = 1; x <= Degree; x++)
327 Prim[x - 1] = x * Coefficients[x];
328
329 double[] Bis = new double[Degree - 1];
330 for (x = 1; x < Degree; x++)
331 Bis[x - 1] = x * Prim[x];
332
333 Array.Reverse(Bis);
334 Array.Reverse(Prim);
335 Coefficients = (double[])Coefficients.Clone();
336 Array.Reverse(Coefficients);
337
338 int size = Width * Height;
339 int[] ColorIndex = new int[size];
340 double Conv = 1e-10;
341 double Div = 1e10;
342
343 rDelta *= 0.5;
344 r0 = rCenter - rDelta;
345 r1 = rCenter + rDelta;
346
347 aspect = ((double)Width) / Height;
348
349 i0 = iCenter - rDelta / aspect;
350 i1 = iCenter + rDelta / aspect;
351
352 dr = (r1 - r0) / Width;
353 di = (i1 - i0) / Height;
354
355 for (y = 0, i = i0, index = 0; y < Height; y++, i += di)
356 {
357 for (x = 0, r = r0; x < Width; x++, r += dr)
358 {
359 zr = r;
360 zi = i;
361
362 n = 0;
363 do
364 {
365 // f:
366 zr2 = zi2 = 0;
367 foreach (double C in Coefficients)
368 {
369 Temp = zr2 * zr - zi2 * zi + C;
370 zi2 = zr2 * zi + zi2 * zr;
371 zr2 = Temp;
372 }
373
374 // f':
375 zr3 = zi3 = 0;
376 foreach (double C in Prim)
377 {
378 Temp = zr3 * zr - zi3 * zi + C;
379 zi3 = zr3 * zi + zi3 * zr;
380 zr3 = Temp;
381 }
382
383 // f":
384 zr4 = zi4 = 0;
385 foreach (double C in Bis)
386 {
387 Temp = zr4 * zr - zi4 * zi + C;
388 zi4 = zr4 * zi + zi4 * zr;
389 zr4 = Temp;
390 }
391
392 // 2*f*f'
393
394 zr5 = 2 * (zr2 * zr3 - zi2 * zi3);
395 zi5 = 2 * (zr2 * zi3 + zi2 * zr3);
396
397 // 2f'^2-f*f"
398
399 zr6 = 2 * (zr3 * zr3 - zi3 * zi3) - (zr2 * zr4 - zi2 * zi4);
400 zi6 = 4 * zr3 * zi3 - (zr2 * zi4 + zr4 * zi2);
401
402 // R*2*f*f'/2f'^2-f*f"
403
404 Temp = 1.0 / (zr6 * zr6 + zi6 * zi6);
405 zr4 = (zr5 * zr6 + zi5 * zi6) * Temp;
406 zi4 = (zi5 * zr6 - zr5 * zi6) * Temp;
407
408 // R*2*f*f'/(2f'^2-f*f")
409 Temp = zr4 * RRe - zi4 * RIm;
410 zi4 = zr4 * RIm + zi4 * RRe;
411 zr4 = Temp;
412
413 zr -= zr4;
414 zi -= zi4;
415
416 Temp = Math.Sqrt(zr4 * zr4 + zi4 * zi4);
417 }
418 while ((Temp > Conv) && (Temp < Div) && (n++ < N));
419
420 if (Temp < Conv && n < N)
421 ColorIndex[index++] = n;
422 else
423 ColorIndex[index++] = N;
424 }
425 }
426
427 ColorIndex = FractalGraph.FindBoundaries(ColorIndex, Width, Height);
428
429 return new FractalGraph(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette),
430 r0, i0, r1, i1, rDelta * 2, true, Node, FractalZoomScript, State);
431 }
432
436 public static FractalGraph CalcHalley(Variables Variables, double rCenter, double iCenter, double rDelta, Complex R,
437 Complex[] Coefficients, SKColor[] Palette, int Width, int Height, ScriptNode Node, FractalZoomScript FractalZoomScript,
438 object State)
439 {
440 double RRe = R.Real;
441 double RIm = R.Imaginary;
442 double r0, i0, r1, i1;
443 double dr, di;
444 double r, i;
445 double zr, zi, zr2, zi2, zr3, zi3, zr4, zi4, zr5, zi5, zr6, zi6;
446 double aspect;
447 double Temp;
448 int x, y;
449 int n, N;
450 int index;
451 int Degree = Coefficients.Length - 1;
452
453 N = Palette.Length;
454
455 if (Degree < 3)
456 {
457 Array.Resize(ref Coefficients, 4);
458 while (Degree < 3)
459 Coefficients[++Degree] = Complex.Zero;
460 }
461
462 Complex[] Prim = new Complex[Degree];
463 for (x = 1; x <= Degree; x++)
464 Prim[x - 1] = x * Coefficients[x];
465
466 Complex[] Bis = new Complex[Degree - 1];
467 for (x = 1; x < Degree; x++)
468 Bis[x - 1] = x * Prim[x];
469
470 Array.Reverse(Bis);
471 Array.Reverse(Prim);
472 Coefficients = (Complex[])Coefficients.Clone();
473 Array.Reverse(Coefficients);
474
475 int j, c = Prim.Length;
476 int c2 = c - 1;
477 double[] ReC = new double[c + 1];
478 double[] ImC = new double[c + 1];
479 double[] RePrim = new double[c];
480 double[] ImPrim = new double[c];
481 double[] ReBis = new double[c2];
482 double[] ImBis = new double[c2];
483 Complex z;
484
485 for (j = 0; j < c; j++)
486 {
487 z = Coefficients[j];
488 ReC[j] = z.Real;
489 ImC[j] = z.Imaginary;
490
491 z = Prim[j];
492 RePrim[j] = z.Real;
493 ImPrim[j] = z.Imaginary;
494
495 if (j < c2)
496 {
497 z = Bis[j];
498 ReBis[j] = z.Real;
499 ImBis[j] = z.Imaginary;
500 }
501 }
502
503 z = Coefficients[j];
504 ReC[j] = z.Real;
505 ImC[j] = z.Imaginary;
506
507 int size = Width * Height;
508 int[] ColorIndex = new int[size];
509 double Conv = 1e-10;
510 double Div = 1e10;
511
512 rDelta *= 0.5;
513 r0 = rCenter - rDelta;
514 r1 = rCenter + rDelta;
515
516 aspect = ((double)Width) / Height;
517
518 i0 = iCenter - rDelta / aspect;
519 i1 = iCenter + rDelta / aspect;
520
521 dr = (r1 - r0) / Width;
522 di = (i1 - i0) / Height;
523
524 for (y = 0, i = i0, index = 0; y < Height; y++, i += di)
525 {
526 for (x = 0, r = r0; x < Width; x++, r += dr)
527 {
528 zr = r;
529 zi = i;
530
531 n = 0;
532 do
533 {
534 // f:
535 zr2 = zi2 = 0;
536 for (j = 0; j <= c; j++)
537 {
538 Temp = zr2 * zr - zi2 * zi + ReC[j];
539 zi2 = zr2 * zi + zi2 * zr + ImC[j];
540 zr2 = Temp;
541 }
542
543 // f':
544 zr3 = zi3 = 0;
545 for (j = 0; j < c; j++)
546 {
547 Temp = zr3 * zr - zi3 * zi + RePrim[j];
548 zi3 = zr3 * zi + zi3 * zr + ImPrim[j];
549 zr3 = Temp;
550 }
551
552 // f":
553 zr4 = zi4 = 0;
554 for (j = 0; j < c2; j++)
555 {
556 Temp = zr4 * zr - zi4 * zi + ReBis[j];
557 zi4 = zr4 * zi + zi4 * zr + ImBis[j];
558 zr4 = Temp;
559 }
560
561 // 2*f*f'
562
563 zr5 = 2 * (zr2 * zr3 - zi2 * zi3);
564 zi5 = 2 * (zr2 * zi3 + zi2 * zr3);
565
566 // 2f'^2-f*f"
567
568 zr6 = 2 * (zr3 * zr3 - zi3 * zi3) - (zr2 * zr4 - zi2 * zi4);
569 zi6 = 4 * zr3 * zi3 - (zr2 * zi4 + zr4 * zi2);
570
571 // R*2*f*f'/2f'^2-f*f"
572
573 Temp = 1.0 / (zr6 * zr6 + zi6 * zi6);
574 zr4 = (zr5 * zr6 + zi5 * zi6) * Temp;
575 zi4 = (zi5 * zr6 - zr5 * zi6) * Temp;
576
577 // R*2*f*f'/(2f'^2-f*f")
578 Temp = zr4 * RRe - zi4 * RIm;
579 zi4 = zr4 * RIm + zi4 * RRe;
580 zr4 = Temp;
581
582 zr -= zr4;
583 zi -= zi4;
584
585 Temp = Math.Sqrt(zr4 * zr4 + zi4 * zi4);
586 }
587 while ((Temp > Conv) && (Temp < Div) && (n++ < N));
588
589 if (Temp < Conv && n < N)
590 ColorIndex[index++] = n;
591 else
592 ColorIndex[index++] = N;
593 }
594 }
595
596 ColorIndex = FractalGraph.FindBoundaries(ColorIndex, Width, Height);
597
598 return new FractalGraph(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette),
599 r0, i0, r1, i1, rDelta * 2, true, Node, FractalZoomScript, State);
600 }
601
605 public static FractalGraph CalcHalley(double rCenter, double iCenter, double rDelta, Complex R,
606 ILambdaExpression f, Variables Variables, SKColor[] Palette, int Width, int Height,
607 ScriptNode Node, FractalZoomScript FractalZoomScript, object State)
608 {
609 double RRe = R.Real;
610 double RIm = R.Imaginary;
611 double r0, i0, r1, i1;
612 double dr, di;
613 double r, i;
614 double aspect;
615 int x, y;
616 int n, N;
617
618 N = Palette.Length;
619
620 Variables v = new Variables();
621 Variables.CopyTo(v);
622
623 string ParameterName;
624 if (!(f is IDifferentiable Differentiable) ||
625 !(Differentiable.Differentiate(ParameterName = Differentiable.DefaultVariableName, v) is ILambdaExpression fPrim))
626 {
627 throw new ScriptRuntimeException("Lambda expression not differentiable.", Node);
628 }
629
630 if (!(fPrim is IDifferentiable Differentiable2) ||
631 !(Differentiable2.Differentiate(ParameterName, v) is ILambdaExpression fBis))
632 {
633 throw new ScriptRuntimeException("Lambda expression not twice differentiable.", Node);
634 }
635
636 int size = Width * Height;
637 int[] ColorIndex = new int[size];
638 double Conv = 1e-10;
639 double Div = 1e10;
640
641 Complex[] Row;
642 Complex[] Row2;
643 Complex[] Row3;
644 Complex[] Row4;
645 int[] Offset;
646 IElement[] P = new IElement[1];
647 int j, c, x2;
648 IElement Obj, Obj2, Obj3;
649 double Mod;
650 Complex z, z2, z3;
651 Complex R2 = R * 2;
652
653 rDelta *= 0.5;
654 r0 = rCenter - rDelta;
655 r1 = rCenter + rDelta;
656
657 aspect = ((double)Width) / Height;
658
659 i0 = iCenter - rDelta / aspect;
660 i1 = iCenter + rDelta / aspect;
661
662 dr = (r1 - r0) / Width;
663 di = (i1 - i0) / Height;
664
665 for (y = 0, i = i0; y < Height; y++, i += di)
666 {
667 Row = new Complex[Width];
668 Offset = new int[Width];
669
670 c = Width;
671 for (x = 0, x2 = y * Width, r = r0; x < Width; x++, r += dr, x2++)
672 {
673 Row[x] = new Complex(r, i);
674 Offset[x] = x2;
675 }
676
677 n = 0;
678 while (n < N && c > 0)
679 {
680 n++;
681 P[0] = new ComplexVector(Row);
682 Obj = f.Evaluate(P, v);
683 Obj2 = fPrim.Evaluate(P, v);
684 Obj3 = fBis.Evaluate(P, v);
685 Row2 = Obj.AssociatedObjectValue as Complex[];
686 Row3 = Obj2.AssociatedObjectValue as Complex[];
687 Row4 = Obj3.AssociatedObjectValue as Complex[];
688
689 if (Row2 is null || Row3 is null || Row4 is null)
690 {
691 throw new ScriptRuntimeException("Lambda expression (and its first and second derivative) must be able to accept complex vectors, " +
692 "and return complex vectors of equal length. Type returned: " +
693 Obj.GetType().FullName + ", " + Obj2.GetType().FullName + " and " + Obj3.GetType().FullName,
694 Node);
695 }
696 else if (Row2.Length != c || Row3.Length != c)
697 {
698 throw new ScriptRuntimeException("Lambda expression (and its first and second derivative) must be able to accept complex vectors, " +
699 "and return complex vectors of equal length. Length returned: " +
700 Row2.Length.ToString() + ", " + Row3.Length.ToString() + " and " + Row4.Length.ToString() +
701 ". Expected: " + c.ToString(), Node);
702 }
703
704 for (x = x2 = 0; x < c; x++)
705 {
706 j = Offset[x];
707 z = Row2[x];
708 z2 = Row3[x];
709 z3 = Row4[x];
710
711 z = R2 * z * z2 / (2 * z2 * z2 - z * z3);
712 Row[x] -= z;
713
714 Mod = z.Magnitude;
715
716 if (Mod > Conv && Mod < Div)
717 {
718 if (x != x2)
719 Offset[x2] = j;
720
721 x2++;
722 }
723 else
724 {
725 if (n >= N)
726 ColorIndex[j++] = N;
727 else
728 ColorIndex[j++] = n;
729 }
730 }
731
732 if (x2 < x)
733 {
734 Array.Resize(ref Row, x2);
735 Array.Resize(ref Offset, x2);
736 c = x2;
737 }
738 }
739 }
740
741 ColorIndex = FractalGraph.FindBoundaries(ColorIndex, Width, Height);
742
743 return new FractalGraph(Variables, FractalGraph.ToPixels(ColorIndex, Width, Height, Palette),
744 r0, i0, r1, i1, rDelta * 2, true, Node, FractalZoomScript, State);
745 }
746
750 public override string FunctionName => nameof(HalleyTopographyFractal);
751 }
752}
Class managing a script expression.
Definition: Expression.cs:39
static Complex ToComplex(object Object)
Converts an object to a complex value.
Definition: Expression.cs:4942
static double ToDouble(object Object)
Converts an object to a double value.
Definition: Expression.cs:4824
static string ToString(double Value)
Converts a value to a string, that can be parsed as part of an expression.
Definition: Expression.cs:4496
HalleyTopographyFractal(ScriptNode z, ScriptNode dr, ScriptNode R, ScriptNode Coefficients, int Start, int Length, Expression Expression)
TODO
HalleyTopographyFractal(ScriptNode z, ScriptNode dr, int Start, int Length, Expression Expression)
TODO
HalleyTopographyFractal(ScriptNode z, ScriptNode dr, ScriptNode R, ScriptNode Coefficients, ScriptNode Palette, ScriptNode DimX, ScriptNode DimY, int Start, int Length, Expression Expression)
TODO
override IElement Evaluate(IElement[] Arguments, Variables Variables)
TODO
HalleyTopographyFractal(ScriptNode z, ScriptNode dr, ScriptNode R, ScriptNode Coefficients, ScriptNode Palette, ScriptNode DimX, int Start, int Length, Expression Expression)
TODO
static FractalGraph CalcHalley(Variables Variables, double rCenter, double iCenter, double rDelta, Complex R, double[] Coefficients, SKColor[] Palette, int Width, int Height, ScriptNode Node, FractalZoomScript FractalZoomScript, object State)
TODO
HalleyTopographyFractal(ScriptNode z, ScriptNode dr, ScriptNode R, ScriptNode Coefficients, ScriptNode Palette, int Start, int Length, Expression Expression)
TODO
static FractalGraph CalcHalley(Variables Variables, double rCenter, double iCenter, double rDelta, Complex R, Complex[] Coefficients, SKColor[] Palette, int Width, int Height, ScriptNode Node, FractalZoomScript FractalZoomScript, object State)
TODO
static FractalGraph CalcHalley(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
HalleyTopographyFractal(ScriptNode z, ScriptNode dr, ScriptNode R, int Start, int Length, Expression Expression)
TODO
Defines a clickable fractal graph in the complex plane.
Definition: FractalGraph.cs:22
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
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:400
Basic interface for all types of elements.
Definition: IElement.cs:20
object AssociatedObjectValue
Associated object value.
Definition: IElement.cs:33
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