凸包类(参考网上方法)
#ifndef POINT_HPP
#define POINT_HPP
#include<iostream>
#include<cmath>
#include<stack>
using namespace std;
class mpoint{ //class point(x, y)
public:
double x;
double y;
mpoint(double xx = 0, double yy = 0){
x = xx;
y = yy;
}
};
int get_miny_point_id(mpoint *points, int size){ //get the point with min_y
int i, min_id = 0;
double miny = 10000;
for(i = 0; i < size; i++){
if(points[i].y < miny){
miny = points[i].y;
min_id = i;
}
}
return min_id;
}
void get_cos(mpoint *points, double *mcos, int id, int size){ //get point's cos
int i;
double coss;
for(i = 0; i < size; i++){
if(i == id){
mcos[i] = 2;
}
else{
coss = (points[i].x - points[id].x) / sqrt((points[i].x - points[id].x