pub fn sort_polar_angle_ccw(input_set: &Vec<Point2D>) -> Vec<Point2D> {
    let mut fat_pt_vec: Vec<Fatpoint2D> = Vec::new();
    //convert all the point2D as FatPoints
    if let Some((first, elements)) = input_set.split_first() {
        fat_pt_vec = elements
            .iter()
            .map(|point| Fatpoint2D::new(point, &first))
            .collect();
    };
    //sort the fatpoint vec
    fat_pt_vec.sort_by(|a, b| b.partial_cmp_distance(a).unwrap());
    fat_pt_vec.sort_by(|a, b| a.partial_cmp(b).unwrap());
    fat_pt_vec.dedup_by(|a, b| a.eq_polar_angle(b));
    //convert back to point2d
    let mut output = Vec::new();
    if let Some(first) = input_set.get(0) {
        output.push(Fatpoint2D::new(first, &first).to_point())
    }
    for fat_point in fat_pt_vec.iter() {
        output.push(fat_point.to_point());
    }
    output
}
///Sorts the  elements of input set by polar
///angle in counter clockwise order around pivot point.
///(if more than one point has the same angle, remove all
///but the one that is farthest from pivot point)
Sorts the  elements of input set by polar
angle in counter clockwise order around pivot point.
(if more than one point has the same angle, remove all
but the one that is farthest from pivot point)
Sorts the elements of input set by polar angle in counter clockwise order around pivot point . ( if more than one point has the same angle remove all but the one that is farthest from pivot point )
pub fn sort_polar_angle_ccw(input_set: &Vec<Point2D>) -> Vec<Point2D> {
    let mut fat_pt_vec: Vec<Fatpoint2D> = Vec::new();
    //convert all the point2D as FatPoints
    if let Some((first, elements)) = input_set.split_first() {
        fat_pt_vec = elements
            .iter()
            .map(|point| Fatpoint2D::new(point, &first))
            .collect();
    };
    //sort the fatpoint vec
    fat_pt_vec.sort_by(|a, b| b.partial_cmp_distance(a).unwrap());
    fat_pt_vec.sort_by(|a, b| a.partial_cmp(b).unwrap());
    fat_pt_vec.dedup_by(|a, b| a.eq_polar_angle(b));
    //convert back to point2d
    let mut output = Vec::new();
    if let Some(first) = input_set.get(0) {
        output.push(Fatpoint2D::new(first, &first).to_point())
    }
    for fat_point in fat_pt_vec.iter() {
        output.push(fat_point.to_point());
    }
    output
}
pub fn sort_polar_angle_ccw ( input_set : & Vec < Point2D > ) -> Vec < Point2D > { let mut fat_pt_vec : Vec < Fatpoint2D > = Vec :: new ( ) ; //convert all the point2D as FatPoints if let Some ( ( first , elements ) ) = input_set . split_first ( ) { fat_pt_vec = elements . iter ( ) . map ( | point | Fatpoint2D :: new ( point , & first ) ) . collect ( ) ; } ; //sort the fatpoint vec fat_pt_vec . sort_by ( | a , b | b . partial_cmp_distance ( a ) . unwrap ( ) ) ; fat_pt_vec . sort_by ( | a , b | a . partial_cmp ( b ) . unwrap ( ) ) ; fat_pt_vec . dedup_by ( | a , b | a . eq_polar_angle ( b ) ) ; //convert back to point2d let mut output = Vec :: new ( ) ; if let Some ( first ) = input_set . get ( 0 ) { output . push ( Fatpoint2D :: new ( first , & first ) . to_point ( ) ) } for fat_point in fat_pt_vec . iter ( ) { output . push ( fat_point . to_point ( ) ) ; } output }
Sorts the  elements of input set by polar
angle in counter clockwise order around pivot point.
Sorts the elements of input set by polar angle in counter clockwise order around pivot point .
input_set
&Vec<Point2D>
input_set
&Vec<Point2D>