pub fn sort_input(input_set: &mut Vec<Point2D>) -> Vec<Point2D> {
    //panic when input_set has less than or equalto 2 elements
    assert!(input_set.len() > 2);

    //find the pivot point in the input set with the
    //minimum y-coordinate, or the leftmost such point
    //in case of tie and set the pivot point as first
    //element of the set
    set_pivot(input_set);

    //sort the remianing elements in 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)
    sort_polar_angle_ccw(input_set)
}
/// Prepares the input set for executing the algorithm.
/// 
/// Finds the first hull element and sorts the rest 
/// of the elements based on angle formed with the first
/// hull element
/// 
/// # Panics
/// Panics when size of input is not atleast 3
/// 
Prepares the input set for executing the algorithm.
Finds the first hull element and sorts the rest
of the elements based on angle formed with the first
hull element
Prepares the input set for executing the algorithm . Finds the first hull element and sorts the rest of the elements based on angle formed with the first hull element
pub fn sort_input(input_set: &mut Vec<Point2D>) -> Vec<Point2D> {
    //panic when input_set has less than or equalto 2 elements
    assert!(input_set.len() > 2);
    //find the pivot point in the input set with the
    //minimum y-coordinate, or the leftmost such point
    //in case of tie and set the pivot point as first
    //element of the set
    set_pivot(input_set);
    //sort the remianing elements in 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)
    sort_polar_angle_ccw(input_set)
}
pub fn sort_input ( input_set : & mut Vec < Point2D > ) -> Vec < Point2D > { //panic when input_set has less than or equalto 2 elements assert ! ( input_set len ( ) 2 ) ; //find the pivot point in the input set with the //minimum y-coordinate, or the leftmost such point //in case of tie and set the pivot point as first //element of the set set_pivot ( input_set ) ; //sort the remianing elements in 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) sort_polar_angle_ccw ( input_set ) }
Prepares the input set for executing the algorithm.
Prepares the input set for executing the algorithm .
input_set
&mut Vec<Point2D>
input_set
&mut Vec<Point2D>
panics
Panics when size of input is not atleast 3
Panics when size of input is not atleast 3