Basic lerp function

This commit is contained in:
~erin 2023-07-20 12:05:19 -04:00
parent 4b50993773
commit e061866cf4
Signed by: erin
GPG Key ID: 9A8E308CEFA37A47
1 changed files with 5 additions and 0 deletions

View File

@ -129,3 +129,8 @@ async fn set_servo_position(state: State) {
// I2C control board manages servos
info!("Setting position to {}", state.servo_positions());
}
#[inline]
fn lerp(v0: f32, v1: f32, t: f32) -> f32 {
return (1. - t) * v0 + t * v1;
}