#include<iostream>
#include<vector>
#include<math.h>
#include<algorithm>
using namespace std;
vector<vector<double>> findNodes(vector<vector<double>>& arr);
bool isOrigin(vector<double>& a, vector<double>& b);
bool isOnLeft(vector<double> curNode, vector<double> topMinuOne, vector<double> top);
double distance(vector<double> &a, vector<double> &b);
void test1();
void test2();
int main() {
test1(); //当坐标数组为空时候,测试1
test2(); //当扫描时候有多个坐标在一条直线上时,测试2
}
void test1() {
cout << "test1()输入为空数组:" << endl;
vector<vector<double>> temp;
if (findNodes(temp).size() == 0) {
cout << "test1()输出为空数组,正确" << endl << endl << "-------------" << endl;
}
else {
cout <<
凸包问题(1)-----步进法
最新推荐文章于 2020-07-26 23:08:47 发布
这篇博客主要介绍了使用步进法解决计算机图形学中的凸包问题,通过详细讲解和PPT展示,帮助读者理解这一算法的实现过程。
摘要由CSDN通过智能技术生成