Skip to content

Commit 5177ba3

Browse files
authored
Merge pull request #26 from mattkrick/patch-1
fix ease function example
2 parents 6024362 + c0342d7 commit 5177ba3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const ITEMS = [1,2,3,4,5,6,7,8,9,10];
5353
// expects/returns a number between [0, 1], however strength functions
5454
// expects/returns a value between [-1, 1]
5555
function ease(val) {
56-
const t = val / 2 + 1; // [-1, 1] -> [0, 1]
56+
const t = (val + 1) / 2; // [-1, 1] -> [0, 1]
5757
const easedT = t<.5 ? 2*t*t : -1+(4-2*t)*t;
5858
return easedT * 2 - 1; // [0, 1] -> [-1, 1]
5959
}

0 commit comments

Comments
 (0)