Skip to content

Commit

Permalink
Fix incorrect implementation of pingpong
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheepolution committed Feb 17, 2024
1 parent ef4ef69 commit 3ca9aed
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 3ca9aed

Please sign in to comment.