⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p3_28.m

📁 Advanced Engineering Mathematics using MATLAB by Harman, Dabney, Richert,书中全部源码
💻 M
字号:
% P3_28.M% Rotate triangle and plot results%   Input vertices and angle in degrees%   Calls function vrotp1=input(' Vertex [p11,p12]= ')    % Input the three verticesp2=input(' Vertex [p21,p22]= ')p3=input(' Vertex [p31,p32]= ')theta=input(' Input rotation angle (degrees)= ')x1=vrot(p1',theta);x2=vrot(p2',theta);x3=vrot(p3',theta);% Original triangle  xpts1=[p1(1) p2(1) p3(1) p1(1)];ypts1=[p1(2) p2(2) p3(2) p1(2)];% Rotated trianglexptsrot=[x1(1) x2(1) x3(1) x1(1)];yptsrot=[x1(2) x2(2) x3(2) x1(2)];%plot(xpts1,ypts1), hold onplot(xptsrot,yptsrot)hold offaxis('square'), axis([0 4 0 4])%%  Where is the axis of rotation? Can you modify the %   script to rotate a triangle around its centroid?%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -