******100000分,小弟高分跪求平面几何算法库!!!!!!很急很急,收到后马上给分,我开了好几个贴,到时全部给你 各位在坐的csdn兄弟:现在我正在做一些平面几何相关的东西,自己写起来太多,而且也没有什么时间了,请问有没有相关的平面几何算法库,比如直线交点,圆与直线交点,位置,多边形包含等类似算法的源代码,先谢谢了!.cn 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 矩形旋转变化 |C|// Rect1View.cpp : implementation of the CRect1View class//#include "stdafx.h"#include "Rect1.h"#include "Rect1Doc.h"#include "Rect1View.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CRect1ViewIMPLEMENT_DYNCREATE(CRect1View, CView)BEGIN_MESSAGE_MAP(CRect1View, CView) //{{AFX_MSG_MAP(CRect1View) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAP // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CRect1View construction/destructionCRect1View::CRect1View(){ // TODO: add construction code here}CRect1View::~CRect1View(){}BOOL CRect1View::PreCreateWindow(CREATESTRUCT& cs){ // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs);}/////////////////////////////////////////////////////////////////////////////// CRect1View drawingvoid CRect1View::OnDraw(CDC* pDC){ CRect1Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data herevoid rect1(int,int,double,double,CDC*);int i,xx,yy,xc=320,yc=240,c=100;long j;for(i=0;i<=360;i+=10) { xx=(int)(c*cos(i*3.14159/180)/6.0); yy=(int)(c*sin(i*3.14159/180)/6.0); rect1(xx,yy,c+i/3,i,pDC); for( j=0;j<10000000;j++); }}void rect1(int x,int y,double c,double a,CDC* pDC){double x1,y1,x2,y2,x3,y3;double b,d;int x0=320,y0=240;x1=x+c*cos(a*3.14159/180);y1=y+c*sin(a*3.14159/180);b=c*tan(30*3.14159/180);d=sqrt(b*b+c*c);x2=x+d*cos((a+30)*3.14159/180);y2=y+d*sin((a+30)*3.14159/180);x3=x+b*cos((a+90)*3.14159/180);y3=y+b*sin((a+90)*3.14159/180);pDC->MoveTo((int)(x+x0),(int)(y+y0));pDC->LineTo((int)(x1+x0),(int)(y1+y0));pDC->LineTo((int)(x2+x0),(int)(y2+y0));pDC->LineTo((int)(x3+x0),(int)(y3+y0));pDC->LineTo((int)(x+x0),(int)(y+y0));}/////////////////////////////////////////////////////////////////////////////// CRect1View printingBOOL CRect1View::OnPreparePrinting(CPrintInfo* pInfo){ // default preparation return DoPreparePrinting(pInfo);}void CRect1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/){ // TODO: add extra initialization before printing}void CRect1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/){ // TODO: add cleanup after printing}/////////////////////////////////////////////////////////////////////////////// CRect1View diagnostics#ifdef _DEBUGvoid CRect1View::AssertValid() const{ CView::AssertValid();}void CRect1View::Dump(CDumpContext& dc) const{ CView::Dump(dc);}CRect1Doc* CRect1View::GetDocument() // non-debug version is inline{ ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CRect1Doc))); return (CRect1Doc*)m_pDocument;}#endif //_DEBUG/////////////////////////////////////////////////////////////////////////////// CRect1View message handlers 你给我一天 然后你把你的要求给我把呵呵[email protected]我给你函数 COMM口波特率重复设置疑问 MFC的三点问题 accept 在 多线程里面,能正常Recevie吗? vc++6.0,xp,配套的SDK和ddk在哪里下载,如何安装? 跪求答案 在Dialog中如何调用DDK程序,以及如何从ring3级进入ring0级 天冷,怎么都穿不上第三条裤衩。。。散分散分 有什么方法可以取得使用指定服务的Application 请问用微软MS XML读取XML时如何对付不同的日期格式? 我的程序有如下Warning,是否意味着我的程序有缺陷? 请问关于windows下EPD(电子纸)驱动的开发问题 FindResource怎么找不到DLL中资源 隐式地访问动态链接库
// Rect1View.cpp : implementation of the CRect1View class
//#include "stdafx.h"
#include "Rect1.h"#include "Rect1Doc.h"
#include "Rect1View.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CRect1ViewIMPLEMENT_DYNCREATE(CRect1View, CView)BEGIN_MESSAGE_MAP(CRect1View, CView)
//{{AFX_MSG_MAP(CRect1View)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CRect1View construction/destructionCRect1View::CRect1View()
{
// TODO: add construction code here}CRect1View::~CRect1View()
{
}BOOL CRect1View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs return CView::PreCreateWindow(cs);
}/////////////////////////////////////////////////////////////////////////////
// CRect1View drawingvoid CRect1View::OnDraw(CDC* pDC)
{
CRect1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
void rect1(int,int,double,double,CDC*);
int i,xx,yy,xc=320,yc=240,c=100;
long j;for(i=0;i<=360;i+=10)
{
xx=(int)(c*cos(i*3.14159/180)/6.0);
yy=(int)(c*sin(i*3.14159/180)/6.0);
rect1(xx,yy,c+i/3,i,pDC);
for( j=0;j<10000000;j++);
}
}void rect1(int x,int y,double c,double a,CDC* pDC)
{
double x1,y1,x2,y2,x3,y3;
double b,d;
int x0=320,y0=240;x1=x+c*cos(a*3.14159/180);
y1=y+c*sin(a*3.14159/180);
b=c*tan(30*3.14159/180);
d=sqrt(b*b+c*c);
x2=x+d*cos((a+30)*3.14159/180);
y2=y+d*sin((a+30)*3.14159/180);
x3=x+b*cos((a+90)*3.14159/180);
y3=y+b*sin((a+90)*3.14159/180);
pDC->MoveTo((int)(x+x0),(int)(y+y0));
pDC->LineTo((int)(x1+x0),(int)(y1+y0));pDC->LineTo((int)(x2+x0),(int)(y2+y0));
pDC->LineTo((int)(x3+x0),(int)(y3+y0));pDC->LineTo((int)(x+x0),(int)(y+y0));
}
/////////////////////////////////////////////////////////////////////////////
// CRect1View printingBOOL CRect1View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}void CRect1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}void CRect1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}/////////////////////////////////////////////////////////////////////////////
// CRect1View diagnostics#ifdef _DEBUG
void CRect1View::AssertValid() const
{
CView::AssertValid();
}void CRect1View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}CRect1Doc* CRect1View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CRect1Doc)));
return (CRect1Doc*)m_pDocument;
}
#endif //_DEBUG/////////////////////////////////////////////////////////////////////////////
// CRect1View message handlers
然后你把你的要求给我把
呵呵
[email protected]
我给你函数