Files
NixOS-configs/modules/wallpaper-engine/scripts/jsmodules/wemath.js
2025-02-07 17:04:43 -06:00

14 lines
275 B
JavaScript

'use strict';
export let deg2rad = Math.PI / 180;
export let rad2deg = 180 / Math.PI;
export function smoothStep(min, max, v) {
let x = Math.max(0, Math.min(1, (v-min)/(max-min)));
return x*x*(3-2*x);
};
export function mix(a, b, v) {
return a+(b-a)*v;
};