Created
October 25, 2024 16:01
-
-
Save alilleybrinker/050c93d0e642e85341fda52869539dcf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[rustfmt::skip] | |
fn linear_distance( | |
[x0, y0]: &[f64; 2], | |
[x1, y1]: &[f64; 2], | |
) -> f64 | |
{ | |
let y_component = (y1 - y0).powi(2); | |
let x_component = (x1 - x0).powi(2); | |
(y_component + x_component).sqrt() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment