// pathfinder/geometry/src/util.rs // // Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. //! Various utilities. /// Linear interpolation. #[inline] pub fn lerp(a: f32, b: f32, t: f32) -> f32 { a + (b - a) * t } /// Divides `a` by `b`, rounding up. #[inline] pub fn alignup_i32(a: i32, b: i32) -> i32 { (a + b - 1) / b }