付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 新教材高中生物 第六章 细胞的生命历程 第1节 细胞的增殖(1)教学设计 新人教版必修1
- 五年级英语下册 Unit 2 My favourite season Part A第一课时教学设计1 人教PEP
- 自考内科全新试题及答案揭秘
- 七年级地理下册 第七章 第四节俄罗斯教学设计 (新版)新人教版
- 高中物理 第七章 机械能守恒定律 10 能量守恒定律与能源(1)教案 新人教版必修2
- 中暑中医试题及标准答案分享
- 八年级语文译林版暑假第一单元同步测试卷基础版A卷
- 八年级语文下册知识核心专题非连续文本提取词句填空题易错巩固卷重难点攻关版
- 八年级语文苏教版课后巩固第二单元同步测试卷基础版A卷
- 工业危废综合利用处置中心环境影响控制方案
- 第5课 古代希腊 课件(26张 内嵌视频)
- 2026广东省电力工业燃料有限公司新能源分公司招聘15人笔试模拟试题及答案详解
- 2025年中级会计师《经济法》真题及答案解析
- 2026-2030中国大型锻件市场应用规模及需求前景分析研究报告
- 公共综合廊道工程社会稳定风险评估报告
- 2026日本智能手机行业市场现状供需调研及投资前景规划分析报告
- 2026年秋季湘教版(新版)九年级上册数学教学计划及进度表
- 2026全球智能机器人行业市场深度分析及未来趋势与发展战略研究报告
- 湖北省荆州市监利市2025-2026学年七年级下学期6月期末数学试题(含答案)
- 小学生爱国主义教育与使命担当小学主题班会课件
- 2026年湖北省中考历史试卷(含答案)
评论
0/150
提交评论