武汉理工大学理学院数学系课程实验报告 课 程 名 称: V C 程序设计 班级 日 期 成绩评定 姓名 实验室 理学院机房 老师签名 学号 实验名称 画正弦曲线函数曲线 所用软件 VC++6
0,o ffice 实 验 目 的 及 内 容 利用vc++6
0 编写程序,画出正弦函数曲线 实 验 原 理 步 骤 、 1、新建 MFC APP wizard 工程,建立单文档并命名为 Sin 2、设置映射模式为可变比例映射模式,在 SinView
cpp 中的重载函数 OnParepareDC函数: void CSinView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) { // TODO: Add your specialized code here and/or call the base class CRect rectClient; GetClientRect(rectClient); pDC->SetMapMode(MM_ANISTROPIC); pDC->SetWindowExt(1000,1000); pDC->SetViewportExt(rectClient
right,-rectClient
bottom); pDC->SetViewportOrg(rectClient
right/2,rectClient
bottom/2); CView::OnPrepareDC(pDC, pInfo); } 2、新建 Draw Sin 类,并添加到工程中: (1)新建 Draw Sin
h 头文件,构造 Draw Sin 类 #include"math
h" class DrawSin { private: int m_nFudu; int m_nZhouqi; int m_nXiangwei; CPoint m_pPoint[1