資源簡介
用C++語言編寫數學常用算法(修訂版)光盤代碼

代碼片段和文件信息
//?Curve.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“Curve.h“
#include?“math.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CCurve
CCurve::CCurve()
{
xcur=0;
data=NULL;
datanumber=0;
ymax=1;
ymin=0;
xbegin?=?0;
xinc?=?1;
ixleft?=?0;
ixright?=?100;
bufferlength=0;
lpstate?=?0;
}
CCurve::~CCurve()
{
if(bufferlength>0)
delete?[]data;
}
BEGIN_MESSAGE_MAP(CCurve?CWnd)
//{{AFX_MSG_MAP(CCurve)
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_PAINT()
ON_WM_HSCROLL()
ON_WM_VSCROLL()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CCurve?message?handlers
BOOL?CCurve::PreCreateWindow(CREATESTRUCT&?cs)?
{
//?TODO:?Add?your?specialized?code?here?and/or?call?the?base?class
return?CWnd::PreCreateWindow(cs);
}
void?CCurve::CalcWindowRect(LPRECT?lpClientRect?UINT?nAdjustType)?
{
//?TODO:?Add?your?specialized?code?here?and/or?call?the?base?class
CWnd::CalcWindowRect(lpClientRect?nAdjustType);
}
int?CCurve::OnCreate(LPCREATESTRUCT?lpCreateStruct)?
{
if?(CWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
//?TODO:?Add?your?specialized?creation?code?here
RECT?rect;
rect.bottom?=?0;
rect.left?=?0;
rect.right=0;
rect.top=0;
hscroll.Create(SBS_HORZ?|?SBS_BOTTOMALIGN?|?WS_VISIBLE?rectthis111);
hscroll.SetScrollRange(0100);
vscroll.Create(SBS_VERT?|?SBS_RIGHTALIGN?|?WS_VISIBLE?rectthis112);
vscroll.SetScrollRange(0100);
vscroll.SetScrollPos(100);
return?0;
}
void?CCurve::OnSize(UINT?nType?int?cx?int?cy)?
{
CWnd::OnSize(nType?cx?cy);
//?TODO:?Add?your?message?handler?code?here
this->GetClientRect(&rect);
rect.top=rect.bottom-10;
rect.right?-=?10;
hscroll.MoveWindow(&rect);
this->GetClientRect(&rect);
rect.left=rect.right-10;
rect.bottom?-=10;
vscroll.MoveWindow(&rect);
this->GetClientRect(&rect);
if(rect.Height()<30?||?rect.Width()<20)
return;
rect.top?+=?20;
rect.bottom?-=10;
rect.left?+=2;
rect.right?-=10;
rect.DeflateRect(2222);
}
void?CCurve::OnPaint()?
{
CPaintDC?dc(this);?//?device?context?for?painting
//?TODO:?Add?your?message?handler?code?here
if(datanumber==0)return;
CString?s;
s.Format(“x=%7.3f?y=%7.3f“(double)xcur*xinc+xbegindata[xcur]);
dc.TextOut(00“?????????????????????????????????????????????“);
dc.TextOut(00s);
CRect?r;
r=rect;
r.InflateRect(2222);
CBrush?blackbrush(RGB(000));
dc.FillRect(&r?&blackbrush);
CPen*?oldpen;
int?ixiy;
CPen?bluepen(PS_SOLID1RGB(02550));
oldpen?=?dc.Selectobject(&bluepen);
if(datanumber){
CPoint?*?pt?=?new?CPoint[ixright-ixleft+1];
for(int?j=0;?j<=ixright-ixleft;?j++){
int?i=j+ixleft;
ix?=?rect.left+j*rect.Wi
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????8089??2000-04-15?06:59??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\BUFFER.CPP
?????文件???????7973??2000-07-17?05:27??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\BUFFER.H
?????文件???????1927??2000-03-21?01:03??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\CBUFFER.CPP
?????文件???????2738??2000-03-21?00:47??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\CBUFFER.H
?????文件???????9629??2000-06-02?05:11??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\CFUNC.CPP
?????文件???????8020??2000-06-02?05:20??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\CFUNC.H
?????文件??????17874??2000-07-04?06:53??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\CMATRIX.CPP
?????文件???????5107??2000-05-29?00:15??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\CMATRIX.H
?????文件??????12010??2000-06-13?04:27??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\FUNC.CPP
?????文件??????12741??2000-07-09?05:24??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\FUNC.H
?????文件???????3481??2000-04-08?18:20??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\FUNC1.CPP
?????文件??????29072??2000-07-02?07:14??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\MATRIX.CPP
?????文件???????8156??2000-04-24?23:52??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\MATRIX.H
?????文件???????6081??2000-07-09?05:25??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\SPECFUNC.CPP
?????文件??????14289??2000-07-11?06:51??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\VFUNC.CPP
?????文件???????9781??2000-06-19?19:46??用C++語言編寫數學常用算法(修訂版\光盤內容\BCMATH\VFUNC.H
?????文件???????8230??2009-01-29?09:26??用C++語言編寫數學常用算法(修訂版\光盤內容\CURVE\Curve.cpp
?????文件???????2104??2009-01-29?09:26??用C++語言編寫數學常用算法(修訂版\光盤內容\CURVE\Curve.h
?????文件?????106537??2009-01-22?22:14??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\Debug\mysub.exe
?????文件??????13708??2009-01-22?22:13??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\Debug\mysub.obj
?????文件?????418816??2009-01-22?22:14??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\Debug\mysub.pdb
?????文件???????2380??2009-01-21?22:21??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\Debug\mysub.res
?????文件??????24298??2009-01-22?22:13??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\Debug\mysubDlg.obj
?????文件??????16190??2009-01-22?22:14??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\Debug\mysubwin.obj
?????文件?????105365??2009-01-21?15:52??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\Debug\StdAfx.obj
?????文件?????364544??2009-01-22?22:14??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\Debug\vc60.pdb
?????文件??????35180??2009-01-21?22:21??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\mysub.aps
?????文件???????1092??2009-01-22?23:10??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\mysub.clw
?????文件???????2049??2009-01-21?15:52??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\mysub.cpp
?????文件???????4269??2009-01-21?16:19??用C++語言編寫數學常用算法(修訂版\光盤內容\examples\mysub\mysub.dsp
............此處省略325個文件信息
- 上一篇:C++語言程序設計習題集
- 下一篇:C語言實現linux系統下的MP3播放器源代碼
評論
共有 條評論