Skip to content

Commit

Permalink
clip theta in hypocycloids animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Henderson committed Nov 4, 2023
1 parent a89e9c3 commit ee4fd6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/animations/hypocycloids.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const Hypocycloids = () => {
const ctx = canvas.getContext('2d')!;

const drawFn: DrawFn = ({ theta, n }: DrawArgs) => {
theta = Math.min(theta, 4 * Math.PI - 1e-5);
const r = 1 / n;
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = '#020115';
Expand Down

0 comments on commit ee4fd6f

Please sign in to comment.