Skip to content

Commit

Permalink
fractals: fix slow rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaeguard committed Apr 19, 2024
1 parent e1089cf commit 167aa33
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions julia_sets/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Julia Set

![](./julia_1.png)
![](./julia_2.png)
![](./julia_3.png)
![](./julia_2.png)
Binary file modified julia_sets/julia_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified julia_sets/julia_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed julia_sets/julia_3.png
Binary file not shown.
4 changes: 2 additions & 2 deletions julia_sets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const rlp = Math.random()*1.5+0.5; const rrp = Math.random()*1.5+0.5;
const glp = Math.random()*1.5+0.5; const grp = Math.random()*1.5+0.5;
const blp = Math.random()*1.5+0.5; const brp = Math.random()*1.5+0.5;

const WIDTH = 1000;
const WIDTH = 600;

const canvas = document.getElementById("canvas");
canvas.width = WIDTH;
Expand All @@ -25,7 +25,7 @@ const ctx = canvas.getContext("2d");

const from = -2;
const to = 2;
const step = 0.001;
const step = 0.01;
const gap = to - from;
const mid = Math.floor(gap / 2);

Expand Down
4 changes: 3 additions & 1 deletion mandelbrot/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
![](./mandelbrot_1.png)
# Mandelbrot Fractal

![](./mandelbrot_example.png)
4 changes: 1 addition & 3 deletions mandelbrot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<title>Mandelbrot</title>
</head>
<body>

<canvas id="canvas"></canvas>

<script src="main.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions mandelbrot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const rlp = Math.random()*1.5+0.5; const rrp = Math.random()*1.5+0.5;
const glp = Math.random()*1.5+0.5; const grp = Math.random()*1.5+0.5;
const blp = Math.random()*1.5+0.5; const brp = Math.random()*1.5+0.5;

const WIDTH = 1000;
const WIDTH = 600;

const canvas = document.getElementById("canvas");
canvas.width = WIDTH;
Expand All @@ -28,7 +28,7 @@ const ctx = canvas.getContext("2d");

const from = -2;
const to = 2;
const step = 0.001;
const step = 0.01;
const gap = to - from;
const mid = Math.floor(gap / 2);

Expand Down
Binary file removed mandelbrot/mandelbrot_1.png
Binary file not shown.
Binary file added mandelbrot/mandelbrot_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 167aa33

Please sign in to comment.