




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
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/創(chuàng)建平移量為(-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);/根據(jù)縮放中心,建立平移矩陣 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);/創(chuàng) myMatrix.Translate(x1,y1,MatrixOrder.Append);/GraphicsgCreateGraphics();/g.TransformmyMatrix;/用得到的復合矩陣對圖形進行變換g.DrawPolygon(Pens.Blue, (X1,Y1將坐標系逆時針旋轉(zhuǎn)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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度網(wǎng)絡信息安全工程師雇傭勞務合同協(xié)議
- 二零二五年度全國旅游合同集合:旅游企業(yè)信用體系建設合作協(xié)議
- 2025年度高端企業(yè)人才招聘與培訓人力資源合作協(xié)議
- 二零二五年度特色餐飲店廚師團隊協(xié)作合同
- 二零二五年度民宿租賃合同(含民宿特色旅游線路)
- 二零二五年度離婚后撫養(yǎng)權交接協(xié)議范本
- 二零二五年度住宅小區(qū)鋁合金門窗批量定制安裝合同
- 第二章運輸需求分析與預測(06)課件
- 2025屆高三化學二輪《多視角分析工藝流程試題》
- 《物流系統(tǒng)分析》課件 項目七任務二 認識物流系統(tǒng)仿真
- 遺傳咨詢行業(yè)研究報告
- TCWAN 0112-2024 不銹鋼復合鋼板焊材匹配標準
- 新聞采訪與寫作-馬工程-第二章
- (高清版)JTG 3363-2019 公路橋涵地基與基礎設計規(guī)范
- 周志華-機器學習-Chap01緒論-課件
- 中石油加油站管理標準規(guī)范管理部分
- 高中雷雨完整省公開課金獎全國賽課一等獎微課獲獎課件
- 施工現(xiàn)場安全標準化施工手冊(匯編)
- 《串珠》教案-2024鮮版
- 藥物超敏反應綜合征并人類免疫缺陷病毒感染1例及文獻復習
- (高清版)TDT 1008-2007 土地勘測定界規(guī)程
評論
0/150
提交評論