付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、第五章形变1 “ransMoveprivatevoidder,EventArgsID=11;um= Graphics 第五章形变1 “ransMoveprivatevoidder,EventArgsID=11;um= Graphics g = CreateGraphics();/ (100,100);/ sgroup);/成了平移变换。具体做法是在Form1_MouseClickifum=2) = ififum0)/保X= Y= else/fori=0;i4;sgroupi.X+=ififum0)/保X= Y= else/fori=0;i=2)um = 0;/ (150,1505-1(150,
2、15011 010sin 001001011 = 0sin102e11 010sin 001001011 = 0sin102e,privatevoidder,EventArgsID=12;um= Graphics g = CreateGraphics();/ ifum=2)um0;/ifID12)/旋ifum = 0)/X= Y= else/doubleif(e.XX&e.Yif(e.XX&e.Yaifum = 0)/X= Y= else/doubleif(e.XX&e.Yif(e.XX&e.Ya= elseif(e.XX&e.Ya= Y)/(double)(e.XMatrixmyMatrix
3、=new/创建平移量为(-x0, -y0) /a /右乘一个平移量为(x0, y0) Graphics g = CreateGraphics();/g.Transform = myMatrix;/ sgroup);/ifum=2)um = 0;/ Graphics g = CreateGraphics();/g.Transform = myMatrix;/ sgroup);/ifum=2)um = 0;/ (100,10010010001001011 = 10010001001011 = 10 101 3先建 ,(F) Form2.CS点击解决方案栏目中Form2.CS,打开“Form2.cs
4、MyFormOKCancel publicvoidder,EventArgsxscale=yscale=publicvoidder,EventArgsxscalepublicvoidder,EventArgsxscale=yscale=publicvoidder,EventArgsxscaleyscalepublicpartialclassMyForm:privatefloatxscale,publicpublicpartialclassMyForm:privatefloatxscale,publicfloatgetreturnthis.xscale;publicfloatgetreturnt
5、his.yscale;publicpublicxscale=(float)1.0;yscale= ransScpublicpublicxscale=(float)1.0;yscale= ransScaleprivatevoidID=floatxs,der,EventArgsID =float xs,MyFormmyfnewMyForm(); /if(myf.ShowDialog()=myf.Close(); /如果选择的是“取消”,则关闭 xs=myf.Xscale; ys=myf.Yscale; xs=myf.Xscale; ys=myf.Yscale; GraphicsgCreateGra
6、phics();/psgroup0=newP sgroup1=newP sgroup2=newxs=myf.Xscale; ys=myf.Yscale; GraphicsgCreateGraphics();/psgroup0=newP sgroup1=newP sgroup2=newsgroup3=newpMatrixmyMatrixnewMatrix();/建立矩阵变量,为计算复合矩阵做准备 myMatrix.Translate(-100, -100);/根据缩放中心,建立平移矩阵 myMatrix.Scale(xs, ys, MatrixOrder.Append);/右乘缩放矩阵 myMa
7、trix.Translate(100, 100, MatrixOrder.Append);/右乘平移矩阵g.TransformmyMatrix;/g.DrawPolygon(Pens.Blue, (X1,Y1Y11 10010 1 000(X1,Y1Y11 10010 1 0000101010 1010 = arctg = ransSymetryprivatevoidder,EventArgsID=14;um=Graphicsg=CreateGraphics();/p=Pp ifum2um0;/ID14)/ifum0)/X=Y=p=Pp ifum2um0;/ID14)/ifum0)/X=Y=G
8、raphicsg=CreateGraphics(); XXifum=2)0;/ privatevoidif(x1x2&y1y2)/排除两点重合的情况 doubleif(x1x2&y1y2)/特殊角 angle = 3.1415926 / 2.0;elseif(x1x2&y1y2)/特殊角 angle3.1415926 / 2.0*3.0;angle=angle=angletan(double)(y2-y1)/(double)(x2-180.03.1415926/MatrixmyMatrixangle=angle=angletan(double)(y2-y1)/(double)(x2-180.0
9、3.1415926/MatrixmyMatrixnewMatrix();/myMatrix.Translate(-x1,y1);/MatrixMyM1newMatrix(1,0,0,-1,0,0);/创 myMatrix.Translate(x1,y1,MatrixOrder.Append);/GraphicsgCreateGraphics();/g.TransformmyMatrix;/用得到的复合矩阵对图形进行变换g.DrawPolygon(Pens.Blue, (X1,Y1将坐标系逆时针旋转XX轴为基轴(Y轴为依赖轴)Y11 10010 1 010001010100 1 10101 10
10、010 1 010001010100 1 1010 ransShearprivatevoidder,EventArgsID=15;um=Graphicsg=CreateGraphics();/p=Pp ifum=2)um0;/if ID =ID15)/对称变换和错切变if um = 0)/保X= Y= Graphicsg=CreateGraphics(); Xif um = 2)um0;/完毕,清零,为下一次做准privatevoidXif um = 2)um0;/完毕,清零,为下一次做准privatevoidif(x1x2&y1y2)/排除两点重合的情况 doubleif(x1x2&y1y2)/特殊角 angle = 3.1415926 / 2.0;elseif(x1x2&y1y2)/特殊角 angle3.1415926 / 2.0*3.0;angle=angle=angletan(double)(y2-y1)/(double)(x2-180.03.1415926/MatrixmyMatrixnewMatrix();/myMatrix.Translate(-x1,y1);/myMatrix.Shear(float1.0,0,MatrixOrder.Append);/e(floatangle,MatrixOrder.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《骨科》主治医师专业知识考试题库(附含答案)
- 防火隔离带施工方案范本
- 2026年VTE、伤口造口相关知识培训后考核试题及答案
- 2026年客房服务员能力测试卷及答案
- 2026服务行业人员考试题库及满分答案
- 施工现场施工暖通工程方案
- 2026年设计构成考试题目及答案
- 2025年养老护理员生活照护部分测试题含答案
- 2026年注册公用设备工程师考试《专业考试》试题及答案
- 第16课 苏东坡与西子湖教学设计小学地方、校本课程浙教版人·自然·社会
- 国家职业标准 4-10-01-06 家政服务员(整 理收纳师) (2026年版)
- 2026年咸阳市文化旅游发展集团有限公司招聘(27人)笔试参考试题及答案解析
- 2026新能源汽车换电模式发展现状及市场前景研究报告
- Unit 7 A Good Read 单元练习题新教材人教版英语八年级下册
- 2026年山东省高三高考二模化学模拟试卷试题(含答案详解)
- 相互担保解除协议书
- 2026年4月自考07816公共行政学试题
- 2025年军考士官试卷及答案(完整版)
- 2026年云南省中考化学模拟试卷(含答案)
- 2026检验类之临床医学检验技术(士)真题附答案
- 跨学科素养导向下的初中地理中考复习教案:东南亚区域深度学习与实践应用
评论
0/150
提交评论