Question

Need a program that prints out a graph for the sin(x) for values of x from...

Need a program that prints out a graph for the sin(x) for values of x from 0 to 2*PI in increments of .05. Only variables, loops and printf is allowed. No strings or anything complicated.

Can be in any language of the following, Java, Python, C.

The output should look like:
                         *
                           *
                             *
                               *
                                 *
                                  *
                                  *
                                  *
                                  *
                                *
                              *
                            *
                          *
                        *
                      *
                    *
                  *
                 *
                *
                *
                *
                 *
                  *
                    *
                       *
                         *

0 0
Add a comment Improve this question Transcribed image text
Answer #1

In Python :

import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0,2*np.pi,0.05);
y = np.sin(x)
plt.plot(x, y, marker="*")
plt.title('Sine Wave Graph')
plt.xlabel('x')
plt.ylabel('y = sin(x)')
plt.show()

please upvote.If any doubt comment below.I will give the answer.Thank You.

Add a comment
Know the answer?
Add Answer to:
Need a program that prints out a graph for the sin(x) for values of x from...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT