-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db619ed
commit 10acbe0
Showing
4 changed files
with
132 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h3>clamp() function</h3> | ||
Restricts an input value to a specified range. | ||
|
||
<p><h4>Syntax</h4> | ||
clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> minimum</i> → The smallest value <i>input</i> is allowed to take.<br> | ||
<i> input</i> → a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br> | ||
<i> maximum</i> → The largest value <i>input</i> is allowed to take.<br> | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
clamp(1,5,10) → 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br> | ||
clamp(1,0,10) → 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br> | ||
clamp(1,11,10) → 10 (<i>input</i> is greater than maximum value of 10, so function returns 11)<br> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<h3>scale_exp() function</h3> | ||
Transforms a given value from an input domain to an output range using an exponential curve. This function can be used to ease values in or out | ||
of the specified output range. | ||
|
||
<p><h4>Syntax</h4> | ||
scale_exp(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>,<i>exponent</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> val</i> → is a value in the input domain. The function will return a corresponding scaled value in the output range.<br> | ||
<i> domain_min, domain_max</i> → specify the input domain, the smallest and largest values the input <i>val</i> should take.<br> | ||
<i> range_min, range_max</i> → specify the output range, the smallest and largest values which should be output by the function.<br> | ||
<i> exponent</i> → a positive value (greater than 0), which dictates the way input values are mapped to the output range. Large exponents will cause the output values to 'ease in', starting slowly before | ||
accelerating as the input values approach the domain maximum. Smaller exponents (less than 1) will cause output values to 'ease out', where the mapping starts quickly but slows as it approaches the domain maximum.<br> | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<b>Easing in, using an exponent of 2:</b><br> | ||
scale_exp(5,0,10,0,100,2) → 25<br> | ||
scale_exp(7.5,0,10,0,100,2) → 56.25<br> | ||
scale_exp(9.5,0,10,0,100,2) → 90.25<br> | ||
<br> | ||
<b>Easing out, using an exponent of 0.5:</b><br> | ||
scale_exp(3,0,10,0,100,0.5) → 54.772<br> | ||
scale_exp(6,0,10,0,100,0.5) → 77.459<br> | ||
scale_exp(9,0,10,0,100,0.5) → 94.868<br> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters