To plot y = sin(x), we must define vectors of x and y values and then use
Question:
x = 0:0.1:6.3; y = sin(x);
plot(x, y)
(a) Let us define a rotation matrix and use it to rotate the graph of y = sin(x). Set
t=pi/4; c = cos(t): s = sin(t); R = [c,-s;s,c]
To find the rotated coordinates, set
Z = R*[x;y]; xl = Z(l,:); yl = Z(2,:);
The vectors xl and yl contain the coordinates for the rotated curve. Set
w = [0. 5]: axis(' square ')
and plot xl and yl using the MATLAB command
plot(xl, yl, w, w)
By what angles has the graph been rotated and in what direction?
(b) Use the rotation matrix R from part (a) to rotate the curve y = - sin(x). Plot the rotated curve. How does the graph compare to that of the curve from part (b)? Explain.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: