Function geometric_features::related_ellipse::principal_axes
source · pub fn principal_axes(polygon: Polygon<'_>) -> (f64, f64)
Expand description
Compute the minor and major axis of the related elipse of a polygon
use geometric_features::related_ellipse::principal_axes;
let polygon = [
(-10.34, -11.32),
( 3.61, 18.34),
( -3.07, -5.34),
( 19.67, 6.5 )
];
let (major_axis, minor_axis) = principal_axes(&polygon);
assert_eq!(major_axis, 23.247229367609776);
assert_eq!(minor_axis, 18.561527921248285);