How Should a Plot of sin(t) vs cos(t) Using linspace in MATLAB Look?

  • Thread starter Thread starter magma_saber
  • Start date Start date
  • Tags Tags
    Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
magma_saber
Messages
73
Reaction score
0

Homework Statement


I have to make a plot with sin(t) (y values) vs cos(t) (x values). The values of t should be between -pi and pi. I'm supposed to use linspace.


Homework Equations





The Attempt at a Solution


i used these lines:

t=linspace(-pi,pi)
plot(cos(t),sin(t))

when i tried it out, the plot came out like this:
2pqnx5i.jpg


it shouldn't look like this should it? its only showing the plot go from -1 to 1.
 
Physics news on Phys.org
magma_saber said:

Homework Statement


I have to make a plot with sin(t) (y values) vs cos(t) (x values). The values of t should be between -pi and pi. I'm supposed to use linspace.


Homework Equations





The Attempt at a Solution


i used these lines:

t=linspace(-pi,pi)
plot(cos(t),sin(t))

when i tried it out, the plot came out like this:
2pqnx5i.jpg


it shouldn't look like this should it? its only showing the plot go from -1 to 1.

If t is a real number, both sin t and cos t have values in the [-1, +1] interval, so your graph is correct (a circle).