LineTo(60*n,0);pDC->LineTo(60*n,-5);pDC->MoveTo(60*n,0);pDC->TextOut(60*n-sPIText[n+1].GetLength()*3,16,sPIText[n+1]);}doubley,radian;pDC->SelectObject(&pen);for(intx=-60;x<600;x++){//弧度=X坐标/曲线宽度*角系数*π//Y坐标=振幅*曲线宽度*sin(弧度)radian=x/((double)60*2)*PI;y=sin(radian)*2*60;pDC->MoveTo((int)x,(int)y);pDC->LineTo((int)x,(int)y);}-IMDN开发者社群-imdn.cn"> LineTo(60*n,0);pDC->LineTo(60*n,-5);pDC->MoveTo(60*n,0);pDC->TextOut(60*n-sPIText[n+1].GetLength()*3,16,sPIText[n+1]);}doubley,radian;pDC->SelectObject(&pen);for(intx=-60;x<600;x++){//弧度=X坐标/曲线宽度*角系数*π//Y坐标=振幅*曲线宽度*sin(弧度)radian=x/((double)60*2)*PI;y=sin(radian)*2*60;pDC->MoveTo((int)x,(int)y);pDC->LineTo((int)x,(int)y);} - IMDN开发者社群-imdn.cn">
登录
首页 » 其他 » VC++ 6.0绘制曲线正弦波

VC++ 6.0绘制曲线正弦波

于 2022-01-21 发布 文件大小:26.87 kB
0 74
下载积分: 2 下载次数: 1

代码说明:

VC++ 6.0 绘制曲线正弦波,一种比较有规律的曲线,源代码也是相当简单的好种。   //建立画笔   CPen cpen,pen;   pen.CreatePen(PS_SOLID,4,RGB(0,0,0));   cpen.CreatePen(PS_SOLID,2,RGB(0,0,255));   pDC->SelectObject(&cpen);   //指定原点   pDC->SetViewportOrg(100,245);   pDC->SetTextColor(RGB(255,0,0));   //绘制横坐标   CString sPIText[]={"-1/2π","","1/2π","π","3/2π","2π","5/2π","3π","7/2π","4π","9/2π","5π"};   for(int n=-1,nTmp=0;nTmpLineTo(60*n,0);    pDC->LineTo(60*n,-5);    pDC->MoveTo(60*n,0);    pDC->TextOut(60*n-sPIText[n+1].GetLength()*3,16,sPIText[n+1]);   }   double y,radian;   pDC->SelectObject(&pen);   for(int x=-60;xMoveTo((int)x,(int)y);    pDC->LineTo((int)x,(int)y);   }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • [综合类]右击鼠标弹出菜单
    [综合类]右击鼠标弹出菜单-[Comprehensive] right-click pop-up menu
    2022-03-04 23:32:49下载
    积分:1
  • C# 锁屏程序
    C# 锁屏程序,也就是大家俗称的“挂机锁”,本程序在界面方面使用了IrisSkin2.dll换肤控件,可实现如截图所示的漂亮窗口。可设置窗体透明度,锁屏程序在输入密码后即可启动,不过要注意一定不要忘记密码哦,否则需要重启电脑了。
    2023-08-11 22:05:03下载
    积分:1
  • Contour lines to deal with the hope of mapping the Arab
    等高线处理,希望对测绘同行们有用阿,也希望大家能够把自己搜集的小冬冬搞上来共享阿-Contour lines to deal with the hope of mapping the Arab-Israeli colleagues useful, I hope you will be able to collect their own small Dongdong engage in up to share the Arab-Israeli
    2022-03-24 23:20:11下载
    积分:1
  • 在vc环境下,基于arcobject开发源码2
    在vc环境下,基于arcobject开发源码2-in vc environment, based on the two-source development arcobject
    2022-03-20 06:12:04下载
    积分:1
  • 高频电子电路设计指导书
    高频电子电路设计指导书-----课程设计说明-High-frequency electronic circuit design to guide curriculum design note book-----
    2022-03-21 16:03:52下载
    积分:1
  • webstar php留言板 v4.6
    webstar php留言板,运行环境:Apache+PHP5 + MySQL数据库。一个比较简单的php留言板,内部设有一个“个人空间”,以便给用户查看管理自己的个人留言等信息。管理员(超级用户)的默认用户名admin,密码为password,可以在config.php中更改。关于留言本的使用方法和详细介绍内有说明文档。   webstar留言本功能更新:   1、主要解决了大家经常跟我提出的页面出现“Notice: Undefined variable...”的问题   2、更改了部分文件的位置和内容,以减少新手们的学习成本和代码的简洁性   3、修正了部分错误链接
    2023-02-22 14:45:04下载
    积分:1
  • b2b网站模版 b2b网站模版 b2b网站模版
    b2b网站模版 b2b网站模版 b2b网站模版-b2bb2b网站模版
    2023-08-05 22:05:03下载
    积分:1
  • prepared by the Three Kingdoms vb source. Study of the Three Kingdoms player hel...
    用vb编写三国志源码.对研究三国志的玩家很有帮助-prepared by the Three Kingdoms vb source. Study of the Three Kingdoms player helpful
    2022-05-30 05:50:33下载
    积分:1
  • 89CS52 connection 8019AS circuit protel 99 format
    89CS52 连接 8019AS电路protel 99 格式-89CS52 connection 8019AS circuit protel 99 format
    2022-04-26 18:26:59下载
    积分:1
  • Python精要参考,一本经典Python参考书
    Python精要参考,一本经典Python参考书-Python Essential Reference, Python a classic reference book
    2022-02-14 00:41:08下载
    积分:1
  • 696524资源总数
  • 103920会员总数
  • 65今日下载