File: formula_mandelbulb_power_2.cpp

package info (click to toggle)
mandelbulber2 2.20-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 149,924 kB
  • sloc: cpp: 79,997; lisp: 30,582; php: 1,798; sh: 897; python: 581; xml: 88; makefile: 42; ansic: 3
file content (10 lines) | stat: -rw-r--r-- 253 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
double x2 = z.x * z.x;
double y2 = z.y * z.y;
double z2 = z.z * z.z;
double temp = 1.0 - z2 / (x2 + y2);
double newx = (x2 - y2) * temp;
double newy = 2.0 * z.x * z.y * temp;
double newz = -2.0 * z.z * sqrt(x2 + y2);
z.x = newx;
z.y = newy;
z.z = newz;