shithub: riscv

ref: 65ef69a85d1c0f4694a361f5a0a99bdbb4f2cd95
dir: /sys/src/libgeometry/utils.c/

View raw version
#include <u.h>
#include <libc.h>
#include <geometry.h>

double
flerp(double a, double b, double t)
{
	return a + (b - a)*t;
}

double
fclamp(double n, double min, double max)
{
	return n < min? min: n > max? max: n;
}