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>>,
  point: &Point<T>,
) -> Result<Polygon<T>, Error>
where
  T: PolygonScalar,
{
  vertices.sort_by(|a, b| point.ccw_cmp_around(a, b));
  Polygon::new(vertices)
}