[][src]Function pathfinder::tools::midpoint

pub fn midpoint(a: Coordinate, b: Coordinate) -> Coordinate

Gives the midpoint between two points.

Examples

Declare the colors and the range at which it becomes darker.

let a = Coordinate::new(0, 0);
let b = Coordinate::new(100, 100);
let mid = tools::midpoint(a, b);
assert_eq!(mid, Coordinate::new(50, 50));