|
本人第一次编的程序,出现了连接错误,想了几天得不到答案,高手帮忙啊,谢了,急!!!!!!!!!!!!
#include "math.h"
//#include"gept2dar.h"
#include"geline2d.h"
//#include"acarray.h"
#include"gepnt2d.h"
#include"gelnsg2d.h"
//以下为计算凸多边形面积方法
double areaofchimb(AcGePoint2dArray&ptarr)
{
AcGePoint2d *p=&ptarr.at(0);
int i;
int n;//点的个数
n=ptarr.length();
AcGePoint2d startpoint=ptarr.first();
AcGePoint2d endpoint=ptarr.last();
//求顶点到其余点的对角线长
double*arry=new double[n-3];
for(i=0;i
//计算多边形面积 !!需要修改,补凸的时候可能使临近两点变凹
double area(AcGePoint2dArray &ptarr)
{
bool PointInPolygon(AcGePoint2d& pt,AcGePoint2dArray &ptarr);
double areaoftriangle(AcGePoint2d ,AcGePoint2d,AcGePoint2d );
int n;//点的个数
n=4;
ptarr.at(0).set(10,10);
ptarr.at(1).set(10,20);
ptarr.at(2).set(20,20);
ptarr.at(3).set(20,10);
double area=0;
double s=0;
int i;
for(i=0;i
}
//以下判断点是否在多边形中,在返回false ,不在返回true
bool PointInPolygon(AcGePoint2d& pt,AcGePoint2dArray &ptarr)
{
int n = ptarr.length();
int i, count=0;
double yup, xup, ydown, xdown;
// double y0, x0;
double t;
for( i=0; i(ptarr.at((i+1)%n).x)?(ptarr.at(i)).xptarr.at((i+1)%n).x);
yup=(ptarr.at(i)).y>(ptarr.at((i+1)%n).y)?(ptarr.at(i)).yptarr.at((i+1)%n).y);
xdown=(ptarr.at(i)).xyup)
continue;
if(pt.yydown)
double t=xdown+(pt.y-ydown)*(xup-xdown)/(yup-ydown);
if(t>pt.x) count++;
if(t=pt.x) return true;
}
if(count%2==0) return false;
else
return true;
}
//计算三角形面积
double areaoftriangle(AcGePoint2d pt1,AcGePoint2d pt2,AcGePoint2d pt3)
{
double a,b,c,l,s;
a=pt1.distanceTo(pt2);
b=pt2.distanceTo(pt3);
c=pt3.distanceTo(pt1);
l=(a+b+c)/2;
s=sqrt(l*(l-a)*(l-b)*(l-c));
return s;
}
--------------------Configuration: Lab5Command - Win32 Debug--------------------
Linking...
Creating library Debug/Lab5Command.lib and object Debug/Lab5Command.exp
Lab5CommandMain.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: double __thiscall AcGePoint2d::distanceTo(class AcGePoint2d const &)const " ()
Lab5CommandMain.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall AcGePoint2d::AcGePoint2d(class AcGePoint2d const &)" ()
Lab5CommandMain.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class AcGePoint2d & __thiscall AcGePoint2d::mirror(class AcGeLine2d const &)" ()
Lab5CommandMain.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall AcGeLine2d::AcGeLine2d(class AcGePoint2d const &,class AcGePoint2d const &)" ()
Lab5CommandMain.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class AcGePoint2d & __thiscall AcGePoint2d::set(double,double)" ()
Lab5CommandMain.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall AcGePoint2d::AcGePoint2d(void)" ()
.\..\Lab5Command.arx : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.
Lab5Command.arx - 7 error(s), 0 warning(s)
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |
|