pub fn interpolate_two_points<T: Coordinate>(
a: &Point<T>,
b: &Point<T>,
at_x: T,
) -> TExpand description
Interpolates the y value at a given x position between two points.
ยงExamples
use pav_regression::Point;
use pav_regression::point::interpolate_two_points;
let point1 = Point::new(0.0, 0.0);
let point2 = Point::new(2.0, 2.0);
let interpolated_y = interpolate_two_points(&point1, &point2, 1.0);
assert_eq!(interpolated_y, 1.0);