Skip to content

Commit 3da2d61

Browse files
committed
New phoenix & fixed old one
1 parent 4842b31 commit 3da2d61

File tree

6 files changed

+98
-17
lines changed

6 files changed

+98
-17
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ set(TARGETS_USE_OPENMP "mandelbrot_bm_cplx_openmp" "mandelbrot_precomp" "mandelb
147147
"mandelbrot_distance" "mandelbrot_wave" "peterdejongM" "newton_orbits" "newton_simple" "newton_max_mod" "mandelbrot_pickover"
148148
"mandelbrot_ltrap" "newton_max_back" "newton_min_angle" "mandelbrot_simple"
149149
"newton_half" "newton_vs" "newton_z6" "newton_modified" "newton_min_root" "newton_3updown" "newton_roter" "attracting_torus_shadowM"
150-
"laguerre_3updown" "laguerre_simple" "kalisetJ" "kalisetM1" "kalisetM2" "phoenix" "phoenixM")
150+
"laguerre_3updown" "laguerre_simple" "kalisetJ" "kalisetM1" "kalisetM2" "phoenix" "phoenixM" "phoenixM2")
151151
set(TARGETS_REQ_BTEST "utest_colorTpl_ia64nGCC" "utest_colorTpl" "utest_ramCanvasTpl" "utest_mjrmath")
152152
set(TARGETS_REQ_SDL2 "displayImageSDL2")
153153

docs/changelog.html

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/changelog.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Copyright \copy {{{time(%Y)}}} Mitch Richling. All rights reserved.
5656
- New
5757
- phoenix: Classic phoenix fractal
5858
- phoenixM: A movie of the classic phoenix fractal
59+
- phoenixM2: Another movie of the classic phoenix fractal
5960
- Updated
6061
- color_lut_docs: Now generates images for all CB schemes
6162
- Miscellaneous

examples/phoenix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ std::vector<std::array<double, 9>> params {
5252
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
5353
int main(void) {
5454
std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
55-
const int WIDTH = 1920*1;
56-
const int HEIGHT = 1920*1;
55+
const int WIDTH = 1920*4;
56+
const int HEIGHT = 1920*4;
5757
const int NUMITR = 500;
5858
const double MAXZ = 4.0;
5959

examples/phoenixM.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// -*- Mode:C++; Coding:us-ascii-unix; fill-column:158 -*-
22
/*******************************************************************************************************************************************************.H.S.**/
33
/**
4-
@file mandelbrot_simple.cpp
4+
@file phoenixM.cpp
55
@author Mitch Richling <https://www.mitchr.me>
6-
@brief Create a Julia set movie.@EOL
6+
@brief Create a phoenix Julia set movie.@EOL
77
@std C++20
8-
@see https://www.mitchr.me/SS/julia/index.html
8+
@see
99
@copyright
1010
@parblock
1111
Copyright (c) 1988-2015, Mitchell Jay Richling <https://www.mitchr.me> All rights reserved.
@@ -27,11 +27,6 @@
2727
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
2828
DAMAGE.
2929
@endparblock
30-
@filedetails
31-
32-
Moves $c$ around a circle just a bit larger than the period 2 disk. A GIF may be rendered from the frames like this:
33-
34-
time convert -delay 1 -loop 0 -dispose previous juliaM_???.tiff juliaM.gif
3530
*/
3631
/*******************************************************************************************************************************************************.H.E.**/
3732
/** @cond exj */
@@ -63,9 +58,7 @@ int main(void) {
6358

6459
const std::complex<double> c(0.566700, 0.00000);
6560
const std::complex<double> p(-0.50000+RADIUS*std::cos(angle), 0.00000+0*RADIUS*std::sin(angle));
66-
67-
//mjr::ramCanvas3c8b theRamCanvas(WIDTH, HEIGHT, -1.35, 1.35, -1.35, 1.35);
68-
mjr::ramCanvas3c8b theRamCanvas(WIDTH, HEIGHT, -0.75, -0.5, 0.13, 0.32);
61+
mjr::ramCanvas3c8b theRamCanvas(WIDTH, HEIGHT, -0.75, -0.5, 0.13, 0.32);
6962

7063
for(int y=0;y<theRamCanvas.getNumPixY();y++) {
7164
for(int x=0;x<theRamCanvas.getNumPixX();x++) {

examples/phoenixM2.cpp

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// -*- Mode:C++; Coding:us-ascii-unix; fill-column:158 -*-
2+
/*******************************************************************************************************************************************************.H.S.**/
3+
/**
4+
@file phoenixM2.cpp
5+
@author Mitch Richling <https://www.mitchr.me>
6+
@brief Create a phoenix Julia set movie.@EOL
7+
@std C++20
8+
@see
9+
@copyright
10+
@parblock
11+
Copyright (c) 1988-2015, Mitchell Jay Richling <https://www.mitchr.me> All rights reserved.
12+
13+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
14+
15+
1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
16+
17+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation
18+
and/or other materials provided with the distribution.
19+
20+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software
21+
without specific prior written permission.
22+
23+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28+
DAMAGE.
29+
@endparblock
30+
*/
31+
/*******************************************************************************************************************************************************.H.E.**/
32+
/** @cond exj */
33+
34+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
35+
#include "ramCanvas.hpp"
36+
37+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
38+
typedef mjr::ramCanvas3c8b::colorType ct;
39+
40+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
41+
int main(void) {
42+
std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
43+
const int WIDTH = 1920/2;
44+
const int HEIGHT = 1920/2;
45+
const int NUMITR = 40;
46+
const double MAXZ = 4.0;
47+
48+
const int NUMFRM = 24*2;
49+
const double ANGMIN = 0.0;
50+
const double ANGMAX = std::numbers::pi*2;
51+
const double RADIUS = 0.06;
52+
53+
# pragma omp parallel for schedule(static,1)
54+
for(int frame=0; frame<NUMFRM; frame++) {
55+
# pragma omp critical
56+
std::cout << "Frame: " << frame << std::endl;
57+
double angle = frame*(ANGMAX-ANGMIN)/NUMFRM+ANGMIN;
58+
59+
const std::complex<double> c(-0.400000+RADIUS*std::cos(angle), 0.10000+RADIUS*std::sin(angle));
60+
const std::complex<double> p(0.29550+RADIUS*std::cos(angle), 0.00000+RADIUS*std::sin(angle));
61+
mjr::ramCanvas3c8b theRamCanvas(WIDTH, HEIGHT, -1.10, 1.10, -1.50, 1.50);
62+
63+
for(int y=0;y<theRamCanvas.getNumPixY();y++) {
64+
for(int x=0;x<theRamCanvas.getNumPixX();x++) {
65+
std::complex<double> z1(theRamCanvas.int2realY(y), theRamCanvas.int2realX(x));
66+
std::complex<double> z2(0.0, 0.0);
67+
int count = 0;
68+
while((std::norm(z1)<MAXZ) && (count<=NUMITR)) {
69+
std::complex<double> z = z1*z1+c+p*z2;
70+
z2 = z1;
71+
z1 = z;
72+
count++;
73+
}
74+
if ((count < NUMITR) && (count > 5))
75+
theRamCanvas.drawPoint(x, y, ct::csCCfractal0RYBCW::c(static_cast<ct::csIntType>(std::log(count)*110)));
76+
}
77+
}
78+
theRamCanvas.writeTIFFfile("phoenixM2_" + mjr::fmtInt(frame, 2, '0') + ".tiff");
79+
# pragma omp critical
80+
std::cout << "FRAME(" << frame << "): " << "DONE" << std::endl;
81+
}
82+
83+
std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
84+
std::cout << "Total Runtime " << runTime.count() << " sec" << std::endl;
85+
}
86+
/** @endcond */

0 commit comments

Comments
 (0)