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