Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

You must upload to Crowdmark both your code (i.e., the Matlab or Python or other prog • Please read the Guidelines for Computing Assignments in Canvas first.• Keep in mind that Canvas discussions are...

1 answer below »
You must upload to Crowdmark both your code (i.e., the Matlab or Python or other prog • Please read the Guidelines for Computing Assignments in Canvas first.
• Keep in mind that Canvas discussions are open forums.
• Acknowledge any collaborations and assistance from colleagues/TAs/instructor.
Programming Preamble:
This bit of Matlab code draws a rectangle. It also places 3 coloured stars at 3 of the corners.
x1=0; x2=1;
y1=0;
y2=2;
x = [x1, x2, x2, x1, x1];
y = [y1, y1, y2, y2, y1];
plot(x, y, ’k-’, ’LineWidth’, 1);
hold on;
>> P=[0 1 1 0;0 0 2 2];
>> plot(P(1,1),P(2,1),’r*’);
>> plot(P(1,2),P(2,2),’g*’);
>> plot(P(1,4),P(2,4),’b*’);
>> axis([ XXXXXXXXXX]);
1
Computing Assignment
Required submission: 1 page PDF document with your answers to the problems here, and a PDF
document with your Matlab or Python code (exported to a .pdf file), both uploaded to Crowdmark
(so, upload 2 things - a one page report and the PDF of your code.).
This computing assignment is designed so that you will demonstrate to yourself that matrices
operate on vectors in R
2
in a way that we can observe geometrically.
1. Part 1 - Geometric transformations
• Vectors
First, choose 2 vectors (note that in the code above these two vectors are (0, 0) and
(1, 2)) the terminal points of which are used to form a rectangle. Plot this rectangle
using code similar to that provided above. Then choose TWO different matrices each
of which performs a single geometric operation of your choice. In both cases, multiply
your 2 vectors by these matrices and plot the resulting rectangles. Include one plot in
your report which shows your original rectangle and your two transformed rectangles.
Include the matrices you used to do the transformation.
• Composition
Verify the result of Problem A6 in Section 3.3 of the text; that the two compositions of a
vertical shear and a stretch in the y direction, do not commute. Do this by plotting the
image of the unit square with corners at (1, 1),(2, 1),(2, 2),(1, 2). Then plot the results
of applying the COMPOSITION of the two operations (vertical shear and stretch) in
both orders and showing that the resulting shape depends on the order in which the
operations are applied. Corroborate your ’experimental proof’ of the non-commutability
of these transformations by referring to Theorem 3.2.5 of the text (i.e., by considering
the associated matrices).
Part 2 −→
2
2. Part 2 - Manipulating an Image
• Consider the following picture:
• Find the matrix that transforms the black rectangle into the red rectangle. Look at
the diagram and observe what has happened to the black rectangle. Form the matrices
that do these operations; there are two. Multiply these matrices in the correct order
to get the transformation matrix A. Experimentally verify that you can plot the black
rectangle yourself and then multiply the vectors that describe the opposite vertices by
A and obtain and plot the red rectangle. Include the matrices you used to do this in
your report.
Answered Same Day Oct 27, 2022

Solution

Baljit answered on Oct 28 2022
54 Votes
Part 1
· Vecto
Matlab code:-
clc
clear all
close all
x1=2;
x2=4;
y1=1;
y2=3;
x=[x1,x2,x2,x1,x1];
y=[y1,y1,y2,y2,y1];
plot(x,y,'k-','linewidth',1)
hold on;
p=[4,1;1,4]*[x1, x2; y1,y2]
P=[2,2; 1,3]*[x1, x2; y1,y2]
x1=[p(1,1), p(1,2),p(1,2),p(1,1),p(1,1)]
y1=[p(2,1),p(2,1),p(2,2),p(2,2),p(2,1)]
x2=[P(1,1), P(1,2),P(1,2),P(1,1),P(1,1)]
y2=[P(2,1),P(2,1),P(2,2),P(2,2),P(2,1)]
plot(x1,y1,'r-','linewidth',1)
plot(x2,y2,'g-','linewidth',1)
axis([0 20 0 20]);
· Composition:-
· Stretch of scale factor 5 followed by Vertical shear of Scale factor...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here