多边形顺时针方向判断公式及C++代码实现一

//#include "PolygonInterMul.h"
#pragma once     //编译一次

#ifndef Const_PI_H
   #define Const_PI_H
   const double PI=3.141592654;
   const double e=2.718;
#endif
#ifndef PolygonInterMul_H
   #define PolygonInterMul_H
    //顶点对象
	public struct Top_Point
	{
		  void set(double x,double y,double z)
		  {
			  this->X =x;
			  this->Y =y;
			  this->Z =z;
		  };
		  double X;
		  double Y;
		  double Z;
	};
	//顶点对象
	public class Top_PointClass 
	{
	public:
		  void set(double x,double y,double z)
		  {
			  this->X =x;
			  this->Y =y;
			  this->Z =z;
		  };
		  double X;
		  double Y;
		  double Z;
	};
	//失量/向量
	public struct Vertex
	{
		void set(double i,double j,double k)
		{
            this->I=i;
			this->J=j;
			this->K=k;
		};
		double I;
		double J;
		double K;
	};
//
class PolygonInterMul 
{
	
	public :
			    PolygonInterMul();
				~PolygonInterMul();
	public :
		//求向量p1->p2
		Vertex getVertex(Top_Point p1,Top_Point p2);
		//求叉积
		Vertex getInterMul(Vertex v1,Vertex v2);
		//求向量夹角
		double getJJ(Vertex v1,Vertex v2);
		//测试
		void Test();
		//三顶点求面积p1->p2->p3  (顶点成逆时针回路)
		double getArea(Top_Point p1,Top_Point p2,Top_Point p3);
		//多顶点求面积  (顶点成逆时针回路)  梯形法
		double getArea(System::Collections::ArrayList PointList);
		double getArea(Top_PointClass *PointArray);  //??
	private:
			   double Nums;
			
};
#endif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值