1 2 3 4 5 6 7 8 9 10 11 12 13
use crate::data::{Point, Polygon};
use crate::{Error, PolygonScalar};
pub fn new_star_polygon<T>(
mut vertices: Vec<Point<T, 2>>,
point: &Point<T, 2>,
) -> Result<Polygon<T>, Error>
where
T: PolygonScalar,
{
vertices.sort_by(|a, b| point.ccw_cmp_around(a, b));
Polygon::new(vertices)
}