float-lerp 0.2.0

Lerp and InverseLerp functions for floats
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 2.33 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.04 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ciwolsey

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)