point_to_line_distance

Function point_to_line_distance 

Source
pub fn point_to_line_distance<P: GetXY + GetZ, Q: GetXY + GetZ>(
    line: &[P],
    point: &Q,
    method: Option<DistanceMethod>,
) -> f64
Expand description

Check to see how far away the point is from the line. Supports both Euclidean and Haversine methods

§Parameters

  • line: the line to check against
  • point: the point to check if it is on the line
  • method: the method to use, either ‘euclidean’ or ‘haversine’. Defaults to DistanceMethod::Euclidean

§Returns

The shortest distance between the point and a line. Returns -1 if line is empty