Skip to content

Latest commit

 

History

History
75 lines (49 loc) · 1.21 KB

tpl.readme.md

File metadata and controls

75 lines (49 loc) · 1.21 KB

${pkg.banner}

npm version npm downloads Twitter Follow

This project is part of the @thi.ng/umbrella monorepo.

About

${pkg.description}

${status}

${supportPackages}

${relatedPackages}

${blogPosts}

Installation

${pkg.install}

${pkg.size}

Dependencies

${pkg.deps}

${examples}

API

${docLink}

import { linear, hermite } from "@thi.ng/ramp";

const rampL = linear([[0.1, 0], [0.5, 1], [0.9, 0]]);
const rampH = hermite([[0.1, 0], [0.5, 1], [0.9, 0]]);

for(let i = 0; i <= 10; i++) {
    console.log(
        i / 10,
        rampL.at(i / 10).toFixed(2),
        rampH.at(i / 10).toFixed(2)
    );
}

// 0   0.00 0.00
// 0.1 0.00 0.00
// 0.2 0.25 0.16
// 0.3 0.50 0.50
// 0.4 0.75 0.84
// 0.5 1.00 1.00
// 0.6 0.75 0.84
// 0.7 0.50 0.50
// 0.8 0.25 0.16
// 0.9 0.00 0.00
// 1   0.00 0.00

Authors

${authors}

${pkg.cite}

License

© ${copyright} // ${license}