math 294 hwk 3 - title('sheared') axis('equal'); axis([-4 4...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%Jim Liu Math 2940, section 1 body = [-1 -.5 0 1 1.5 2 2 -1 -1; % Drawing of body of a car. 1 1 1.5 1.5 1 1 .5 .5 1]; x=body(1,:); y=body(2,:); subplot(2,3,1) plot (x,y,'g') title('Original Car Body by Jim Liu') axis('equal'); axis([-4 4 -4 4]); grid on %rotation theta = .3*pi/4; A = [ cos(theta) -sin(theta); sin(theta) cos(theta) ]; bodynew=A*body; subplot(2,3,2) plot(newbody(1,:), newbody(2,:)); title('Rotation') axis('equal'); axis([-4 4 -4 4]); %shear subplot(2,3,3) shear=[1 .5 ; 0 1]; newbody=shear*body; plot(newbody(1,:), newbody(2,:));
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: title('sheared') axis('equal'); axis([-4 4 -4 4]); %rotate then shear subplot(2,3,4) newbody=shear*A*body; plot(newbody(1,:), newbody(2,:)); title('rotate then shear') axis('equal'); axis([-4 4 -4 4]); %shear then rotate subplot(2,3,5) newbody=A*shear*body; plot(newbody(1,:), newbody(2,:)); title('shear then rotate') axis('equal'); axis([-4 4 -4 4]); The rotate then shear is different from shear then rotate because matrix multiplication is not commutative....
View Full Document

Page1 / 2

math 294 hwk 3 - title('sheared') axis('equal'); axis([-4 4...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online