Skip to main content

reference_line_distance

Function reference_line_distance 

Source
pub fn reference_line_distance(f_norm: &[f64], ref_point: &[f64]) -> f64
Expand description

Compute the perpendicular distance from a normalized objective vector to a reference line (direction vector from origin through reference point).

dist(f, r) = ||f - (f·r / ||r||²) * r||

Both f_norm and ref_point must have the same length.