4.0)) { break; } $zy = (((2.0 * $zx) * $zy) + $ci); $zx = (($zx2 - $zy2) + $cr); $i += 1; } if (($i >= $max_iter)) { $frame[($row_base + $x)] = 0; } else { $color_index = (1 + ((intdiv(($i * 224), $max_iter) + $phase) % 255)); $frame[($row_base + $x)] = $color_index; } } } return bytes($frame); } function run_06_julia_parameter_sweep() { $width = 320; $height = 240; $frames_n = 72; $max_iter = 180; $out_path = "sample/out/06_julia_parameter_sweep.gif"; $start = __pytra_perf_counter(); $frames = []; $center_cr = (-0.745); $center_ci = 0.186; $radius_cr = 0.12; $radius_ci = 0.1; $start_offset = 20; $phase_offset = 180; $__hoisted_cast_3 = ((float)($frames_n)); for ($i = 0; $i < $frames_n; $i += 1) { $t = ((($i + $start_offset) % $frames_n) / $__hoisted_cast_3); $angle = ((2.0 * M_PI) * $t); $cr = ($center_cr + ($radius_cr * cos($angle))); $ci = ($center_ci + ($radius_ci * sin($angle))); $phase = (($phase_offset + ($i * 5)) % 255); $frames[] = render_frame($width, $height, $cr, $ci, $max_iter, $phase); } __pytra_noop($out_path, $width, $height, $frames, julia_palette()); $elapsed = (__pytra_perf_counter() - $start); __pytra_print("output:", $out_path); __pytra_print("frames:", $frames_n); __pytra_print("elapsed_sec:", $elapsed); } function __pytra_main(): void { run_06_julia_parameter_sweep(); } __pytra_main();