Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Probability Discrete Map and Transcendental Fractal Generator #9

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fine adjustements defaults and info hover
tomtuamnuq authored Apr 2, 2024
commit 01cb485457cea5c127fa2ad52ec1e03644417eb2
61 changes: 27 additions & 34 deletions src/chaos/fractal/fractal_conf.rs
Original file line number Diff line number Diff line change
@@ -439,40 +439,37 @@ impl Default for MandelbrotPowerQuaternion {
}

impl Default for MandelbrotTranscendentalComplex {
// Table 2 - test Area -2 to 2
fn default() -> Self {
Self {
alpha: 0.3,
a: 3.0,
b: -0.00000001,
n: 2.0,
alpha: 0.25,
a: 1.0,
b: -0.5,
n: 3.0,
}
}
}
impl Default for MandelbrotTranscendentalDual {
// Table 2 - test Area -2 to 2 TODO Dual
fn default() -> Self {
Self {
alpha: 0.3,
a: 3.0,
b: -0.00000001,
n: 2.0,
a: 0.1,
b: -0.1,
n: 3.0,
}
}
}
impl Default for MandelbrotTranscendentalPerplex {
// Table 2 - test Area -2 to 2 TODO Perplex
fn default() -> Self {
Self {
alpha: 0.3,
a: 3.0,
b: -0.00000001,
alpha: 0.1,
a: 0.2,
b: -1.0,
n: 2.0,
}
}
}
impl Default for MandelbrotTranscendentalQuaternion {
// Table 2 - test Area -2 to 2 TODO Quaternion
// Table 2 - test Area -2 to 2
fn default() -> Self {
Self {
alpha: 0.3,
@@ -623,56 +620,52 @@ impl Default for JuliaPowerQuaternion {
}

impl Default for JuliaTranscendentalComplex {
// Table 4 - test area -10 to 10
fn default() -> Self {
Self {
c_re: 12.75,
c_re: 2.0,
c_im: 0.0,
alpha: 0.0487654321,
a: 16.0,
b: -9.0,
alpha: 0.2,
a: 2.0,
b: -1.0,
n: 2.0,
}
}
}
impl Default for JuliaTranscendentalDual {
// Table 4 - test area -10 to 10 TODO Dual
fn default() -> Self {
Self {
c_re: 12.75,
c_re: 1.0,
c_im: 0.0,
alpha: 0.0487654321,
a: 16.0,
b: -9.0,
a: 0.1,
b: -0.1,
n: 2.0,
}
}
}
impl Default for JuliaTranscendentalPerplex {
// Table 4 - test area -10 to 10 TODO Perplex
fn default() -> Self {
Self {
c_re: 12.75,
c_re: 0.5,
c_im: 0.0,
alpha: 0.0487654321,
a: 16.0,
b: -9.0,
alpha: 0.1,
a: 0.1,
b: 1.0,
n: 2.0,
}
}
}
impl Default for JuliaTranscendentalQuaternion {
// Table 4 - test area -10 to 10 TODO Quaternion
fn default() -> Self {
Self {
c_w: 12.75,
c_i: 0.0,
c_w: 1.0,
c_i: 1.0,
c_j: 0.0,
c_k: 0.0,
alpha: 0.0487654321,
a: 16.0,
b: -9.0,
n: 2.0,
a: 2.0,
b: -1.0,
n: 3.0,
}
}
}
4 changes: 2 additions & 2 deletions src/chaos/functions/discrete_maps.rs
Original file line number Diff line number Diff line change
@@ -614,7 +614,7 @@ impl DiscreteMap for ReverseProbability {
fn execute(&self, v: &mut Self::State, _t: &Time) {
let x = v[0];
let y = v[1];
let r_gen = rand_distr::Uniform::new(0.0, 1.0);
let r_gen: rand_distr::Uniform<ChaosFloat> = rand_distr::Uniform::new(0.0, 1.0);
let mut rng = rand::thread_rng();
let r = r_gen.sample(&mut rng);
let s = if r <= self.r_threshold { -1.0 } else { 1.0 };
@@ -638,7 +638,7 @@ impl Default for ReverseProbability {

impl ChaosDescription for ReverseProbability {
fn description(&self) -> String {
String::from("Adjusted probability reverse Julia by Roger Bagula and Paul Bourke.")
format!("Adjusted probability reverse Julia by Roger Bagula and Paul Bourke. Try the trajectory of the start state z=Complex(x=0, y=0). Currently chosen is c=Complex({:.2}, {:.2}) and R={:.2}", self.c_re, self.c_im, self.r_threshold)
}
fn reference(&self) -> &'static str {
"https://paulbourke.net/fractals/reversejulia/"
Original file line number Diff line number Diff line change
@@ -522,7 +522,7 @@ impl_discrete_variants! {
KaplanYorke, SimpleDiscreteMap, { [alpha, "α"] },
Rulkov, SimpleDiscreteMap, { [alpha, "α"], [mu, "μ"], [delta, "δ"] },
Zaslavskii, SimpleDiscreteMap, { [eps, "ε"], [nu, "ν"], [r, "r"] },
ReverseProbability, SimpleDiscreteMap, { [c_re, " c real"], [c_im, "c imaginary"], [r_threshold, "R"] },
ReverseProbability, SimpleDiscreteMap, { [c_re, "c real"], [c_im, "c imaginary"], [r_threshold, "R"] },
Shah, SimpleDiscreteMap, { [alpha, "α"], [beta, "β"], [gamma, "γ"], [delta, "δ"] },
Memristive, SimpleDiscreteMap, { [k, "k"], [a, "a"] },
Sfsimm, SimpleDiscreteMap, { [p, "p"], [b, "b"], [r, "r"] },