Skip to content

Commit

Permalink
Merge pull request #72 from Sheepolution/pr
Browse files Browse the repository at this point in the history
Fix incorrect implementation of pingpong
  • Loading branch information
1bardesign committed Feb 19, 2024
2 parents ef4ef69 + 3ca9aed commit 63294a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mathx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ end

--pingpong from 0 to 1 and back again
function mathx.pingpong(f)
return 1 - math.abs(f - 0.5) * 2
return 1 - math.abs(1 - f % 2)
end

--quadratic ease in
Expand Down

0 comments on commit 63294a6

Please sign in to comment.