(coords: Args)
| 101 | // Variadic Euclidean norm, matching `math.hypot(*coordinates)`. |
| 102 | #[plugin_fn] |
| 103 | fn hypot(coords: Args) -> Result<f64> { |
| 104 | let mut sum = 0.0; |
| 105 | for h in &coords.0 { let v = f64::from_handle(h.raw())?; sum += v * v; } |
| 106 | Ok(libm::sqrt(sum)) |
| 107 | } |
| 108 | |
| 109 | // Euclidean distance between two equal-length coordinate sequences. |
| 110 | #[plugin_fn] |