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
Click For Summary
The discussion centers on creating a plot of sin(t) versus cos(t) using MATLAB's linspace function for values of t between -pi and pi. The user initially expresses confusion about the resulting plot, which only shows values from -1 to 1. It is clarified that since both sin(t) and cos(t) range from -1 to 1, the output is indeed correct and represents a circle. The plot accurately reflects the relationship between sine and cosine over the specified interval. Understanding this confirms that the user's implementation is valid.
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).
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
0
Views
2K
Replies
1
Views
2K