Skip to content

Commit a73e4d0

Browse files
committed
Update image and change some of the algorithm in the series approximation.
1 parent 5359125 commit a73e4d0

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

output.png

1.23 MB
Loading

src/bin/main.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ fn main() {
1313
// "0.0");
1414
// let zoom = 1.0;
1515

16-
let center = (
17-
"-0.749999987350877481864108888020013802837969258626230419972587823828734338471228477079750588709551510361714463695461745528645748607681279674273355384334270208362211787387351792878073779449767292692440",
18-
"0.001000038688236832013124581230049849132759425863378894883003211011278068229551274712347955044740933397589760194545872789087012331273586364914484522575986336846199522726507205442204060303594956029930");
19-
let zoom = 3.7E191;
16+
// let center = (
17+
// "-0.749999987350877481864108888020013802837969258626230419972587823828734338471228477079750588709551510361714463695461745528645748607681279674273355384334270208362211787387351792878073779449767292692440",
18+
// "0.001000038688236832013124581230049849132759425863378894883003211011278068229551274712347955044740933397589760194545872789087012331273586364914484522575986336846199522726507205442204060303594956029930");
19+
// let zoom = 3.7E191;
2020

2121
// let center = (
2222
// "-1.689573325432279612075987864633746594591438093139394112928000260",
@@ -48,10 +48,10 @@ fn main() {
4848
// "-0.000000000000000000000000000000000300138243679093832407249730397759249873468311907733352701742572801204749756148235811856472992884140755192241865049781816254785289455481579902975133989545509287024987599289178526901586954397865");
4949
// let zoom = 8.80307862787E167;
5050

51-
// let center = (
52-
// "-1.479796270901760024425279934770411525645551054432599517909807632824286254403907594526888466099962805022975196472549771681831234491695559852583955204986197762293872769474806903995564259040667568599770094383157857518790853771783314763231302599999999999999999999999998",
53-
// "-0.001199443952813447746281973233374468444560314114132538362037569205657422216739564521471119107626453330996365067987088146663639996715939831819152248618042255824652268918299630897525386638029428706473919823922522752497780934312003352081931299999999999999999999999998");
54-
// let zoom = 3.27799999998E235;
51+
let center = (
52+
"-1.479796270901760024425279934770411525645551054432599517909807632824286254403907594526888466099962805022975196472549771681831234491695559852583955204986197762293872769474806903995564259040667568599770094383157857518790853771783314763231302599999999999999999999999998",
53+
"-0.001199443952813447746281973233374468444560314114132538362037569205657422216739564521471119107626453330996365067987088146663639996715939831819152248618042255824652268918299630897525386638029428706473919823922522752497780934312003352081931299999999999999999999999998");
54+
let zoom = 3.27799999998E235;
5555

5656
// let center = (
5757
// "-0.74962449737876168207862620426836138684529527812364025754481571424558286479672801698750203976779135608148687747196595174858125388297577788573082753210469806739721377901297451172624762450940529814713048377873612297220313016947039287469999999999999999",
@@ -60,16 +60,16 @@ fn main() {
6060

6161

6262
let mut renderer = FractalRenderer::new(
63-
500,
64-
500,
63+
1000,
64+
1000,
6565
zoom,
66-
5000000,
66+
150000,
6767
center.0,
6868
center.1,
6969
1000,
7070
0.001,
7171
false,
72-
32
72+
64
7373
);
7474

7575
let time = Instant::now();

src/math/series_approximation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl SeriesApproximation {
8989

9090
for k in 1..=self.order {
9191
series_probe += next_coefficients[k] * self.approximation_probes[i][k - 1];
92-
derivative_probe += next_coefficients[k] * self.approximation_probes_derivative[i][k - 1];
92+
derivative_probe += (k + 1) as f64 * next_coefficients[k] * self.approximation_probes_derivative[i][k - 1];
9393
};
9494

9595
let mut relative_error = (self.perturbation_probes[i] - series_probe).norm();
@@ -101,7 +101,7 @@ impl SeriesApproximation {
101101
}
102102

103103
// Check that the error over the derivative is less than the pixel spacing
104-
if relative_error / derivative > 0.5 * self.delta_pixel {
104+
if relative_error / derivative > self.delta_pixel {
105105
return false;
106106
}
107107
}
@@ -141,7 +141,7 @@ impl SeriesApproximation {
141141

142142
for i in 1..=self.order {
143143
delta_probe_n.push(delta_probe_n[i - 1] * delta_probe_scaled);
144-
delta_probe_n_derivative.push((i + 1) as f64 * delta_probe_n_derivative[i - 1] * delta_probe_scaled);
144+
delta_probe_n_derivative.push(delta_probe_n_derivative[i - 1] * delta_probe_scaled);
145145
}
146146

147147
self.approximation_probes.push(delta_probe_n);

0 commit comments

Comments
 (0)