Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
jcponce committed Aug 1, 2024
1 parent 0435f32 commit 5f0ebae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 0 additions & 1 deletion threejs/attractors/lorenz-variation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
}
</script>
<script src="../common/math.js"></script>
<script src="../attractors/lorenz-variation.js"></script>
<script type="module" src="main.js"></script>


Expand Down
22 changes: 22 additions & 0 deletions threejs/attractors/lorenz-variation/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,28 @@ renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
//const axesHelper = new THREE.AxesHelper(5);
//scene.add(axesHelper);

/**
* Lorenz Attractor variation
*/
const initialParams = {
Attractor: "Lorenz variation",
sigma: 10,
rho: 28,
beta: 8 / 3,
};

const params = { ...initialParams };

let attractor = (x, y, z) => {
const { sigma, rho, beta } = params;

const dx = (sigma * (y - x) + (sin(y / 5) * sin(z / 5) * 200)) * .65;
const dy = (x * (rho - z) - y + (sin(x / 5) * sin(z / 5) * 200)) * .65;
const dz = (x * y - beta * z + cos(y / 5) * cos(x / 5) * 200) * .65;

return { dx, dy, dz };
};

/**
* Reset functions
*/
Expand Down

0 comments on commit 5f0ebae

Please sign in to comment.