Crates.io | float-lerp |
lib.rs | float-lerp |
version | 0.2.0 |
source | src |
created_at | 2022-07-06 23:44:30.113965 |
updated_at | 2022-07-06 23:58:36.765568 |
description | Lerp and InverseLerp functions for floats |
homepage | |
repository | |
max_upload_size | |
id | 620824 |
size | 2,194 |
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)
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)