To plot y = sin(x), we must define vectors of x and y values and then use the plot

Chapter 7, Problem 12

(choose chapter or problem)

To plot y = sin(x), we must define vectors of x and y values and then use the plot command. This can be done as follows: 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]; x1 = Z(1, :); y1 = Z(2, :); The vectors x1 and y1 contain the coordinates for the rotated curve. Set w = [0, 5]; axis square and plot x1 and y1, using the MATLAB command plot(x1, y1,w,w) By what angles has the graph been rotated and in what direction? (b) Keep all your variables from part (a) and set G = [c, s; s,c] The matrix G represents a Givens reflection. To determine the reflected coordinates, set Z = G [x; y]; x2 = Z(1, :); y2 = Z(2, :); Plot the reflected curve, using the MATLAB command plot(x2, y2,w,w) The curve y = sin(x) has been reflected about a line through the origin making an angle of /8 with the x-axis. To see this, set w1 = [0, 6.3 cos(t/2)] ; z1 = [0, 6.3 sin(t/2)] ; and plot the new axis and both curves with the MATLAB command plot(x, y, x2, y2, w1, z1) (c) 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. 1

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back