乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 28|回复: 2

高手帮个啊忙啊

[复制链接]

3

主题

7

帖子

2

银币

初来乍到

Rank: 1

铜币
19
发表于 2006-9-2 14:09:00 | 显示全部楼层 |阅读模式
本人第一次编的程序,出现了连接错误,想了几天得不到答案,高手帮忙啊,谢了,急!!!!!!!!!!!!
#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)

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

1

主题

32

帖子

4

银币

初来乍到

Rank: 1

铜币
36
发表于 2006-9-8 09:54:00 | 显示全部楼层
要包含库文件:acge15.lib(视ARX的版本而定,以acge开头的)
回复

使用道具 举报

5

主题

16

帖子

1

银币

初来乍到

Rank: 1

铜币
36
发表于 2006-9-8 17:16:00 | 显示全部楼层
if( (pt.x == (ptarr.at(i).x) && (pt.y==ptarr.at(i).y)  )           //!!检查括号匹配
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-5 20:56 , Processed in 0.173625 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表