凸包问题(1)-----步进法

这篇博客主要介绍了使用步进法解决计算机图形学中的凸包问题,通过详细讲解和PPT展示,帮助读者理解这一算法的实现过程。
摘要由CSDN通过智能技术生成

  讲解ppt 

#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 <<
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值