float-lerp

Crates.iofloat-lerp
lib.rsfloat-lerp
version0.2.0
sourcesrc
created_at2022-07-06 23:44:30.113965
updated_at2022-07-06 23:58:36.765568
descriptionLerp and InverseLerp functions for floats
homepage
repository
max_upload_size
id620824
size2,194
Carl Wolsey (ciwolsey)

documentation

README

Lerp and InverseLerp for float values

lerp

Find the value between two floats using a 0-1 fraction:

// Returns 1.5 because 1.5 is 0.5 distance between 1.0 and 2.0
lerp(1.0, 2.0, 0.5) 

inverse_lerp

Find the fraction a given value lies at between two floats

// Returns 0.5 because 1.5 is 0.5 of the distance between 1.0 and 2.0
inverse_lerp(1.0, 2.0, 1.5)
Commit count: 0

cargo fmt