mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Add docs
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
ba3d7f9bee
commit
d9b8f0d540
@ -14,6 +14,16 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method linearly interpolates between two points (start, end). This is
|
||||||
|
* most commonly used to find a point some fraction of the way along a line
|
||||||
|
* between two endpoints (e.g. to move an object gradually between those
|
||||||
|
* points).
|
||||||
|
* @param {number} start the starting point
|
||||||
|
* @param {number} end the ending point
|
||||||
|
* @param {number} amt the interpolant
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
export function lerp(start: number, end: number, amt: number) {
|
export function lerp(start: number, end: number, amt: number) {
|
||||||
return (1 - amt) * start + amt * end;
|
return (1 - amt) * start + amt * end;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user