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
SUMMARY

The discussion focuses on plotting sin(t) against cos(t) using MATLAB's linspace function, specifically for values of t ranging from -π to π. The user implemented the code t=linspace(-pi,pi) and plot(cos(t),sin(t)), resulting in a plot that correctly represents a circle, as both sin(t) and cos(t) yield values within the interval [-1, 1]. The confusion arose from the expectation of a different visual representation, but the output is indeed accurate for the specified mathematical functions.

PREREQUISITES
  • Understanding of trigonometric functions (sin and cos)
  • Familiarity with MATLAB programming environment
  • Knowledge of the linspace function in MATLAB
  • Basic concepts of plotting in MATLAB
NEXT STEPS
  • Explore MATLAB's plotting functions for advanced visualizations
  • Learn about polar coordinates and how they relate to sin and cos plots
  • Investigate the implications of using different ranges for t in trigonometric plots
  • Study the properties of periodic functions and their graphical representations
USEFUL FOR

Students, educators, and anyone interested in MATLAB programming, particularly those working with trigonometric functions and graphical representations in mathematics.

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
3K
  • · 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