Skip to content

Commit

Permalink
partial revert
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacbowen committed Feb 24, 2024
1 parent ea0e113 commit c8ec1a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ class SphereWithRods {
}

calculateFrequency(t: number): number {
const wrappedT = t % 1; // Wrap t to the range [0, 1]
// Sine function adjusted for [0, 1] range, peaking in the middle
const sineWave = Math.sin(Math.PI * t);

// Parabolic curve equation: -4t^2 + 4t
return -4 * wrappedT * wrappedT + 4 * wrappedT;
// Raise the sine wave to a power to make the curve more dramatic
const power = 20; // Adjust this power to make the curve more or less dramatic
const dramaticSineWave = Math.pow(sineWave, power);

return dramaticSineWave;
}

placeRod(): void {
Expand Down

0 comments on commit c8ec1a3

Please sign in to comment.