Implement Axis targets.

This commit is contained in:
Anna Rose Wiggins 2025-07-10 13:06:24 -04:00
parent ff38db6596
commit 2f7e11e8a2
6 changed files with 79 additions and 35 deletions

View file

@ -0,0 +1,15 @@
package mappingrules
import (
"golang.org/x/exp/constraints"
)
func AbsInt[T constraints.Integer](value T) T {
return max(value, -value)
}
// LerpInt linearly interpolates between two integer values using
// a float64 index value
func LerpInt[T constraints.Integer](min, max T, t float64) T {
return T((1-t)*float64(min) + t*float64(max))
}