Skip to content

Commit

Permalink
feat: Update ease in out with more equations
Browse files Browse the repository at this point in the history
  • Loading branch information
ff6347 committed Dec 2, 2024
1 parent b4a41d0 commit c13b89d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions p5js/motion/ease-out/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@ function draw() {
x = (1 - t) * width;

// Quadratic
x = (1 - pow(t, 2)) * width;
x = (1 - pow(1 - t, 2)) * width;

// Cubic
x = (1 - pow(t, 3)) * width;
x = (1 - pow(1 - t, 3)) * width;

// Quartic
x = (1 - pow(t, 4)) * width;
x = (1 - pow(1 - t, 4)) * width;

// Quintic
x = (1 - pow(t, 5)) * width;
x = (1 - pow(1 - t, 5)) * width;

// Sine based
x = sin((t * PI) / 2) * width;
x = cos(((1 - t) * PI) / 2) * width;

// Exponential
x = (1 - pow(2, -10 * t)) * width;

circle(x, height / 2, 20);

if (x <= 0) {
if (x >= width) {
t = 0;
x = width;
x = 0;
}
}

0 comments on commit c13b89d

Please sign in to comment.