Question

Write a script called “faracha” that plots a vs. b as defined in the following equations:...

Write a script called “faracha” that plots a vs. b as defined in the following equations:

         a = sin(t)[ecos(t) – 2cos(4t) – (sin(t/12)5)]

         b = cos(t)[ ecos(t) – 2cos(4t) – (sin(t/12)5)]

Where t = [-10;10]. Use 0.01 interval for t. Use 0.01 intervals for t.

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

import math
import numpy as np
time = np.arange(-10, 10, 0.01) #this creates a numpy array time having elements between -10 to 10 in the interval of 0.1
# like -10, -9.99, -9.98,.......,0,.......9.98, 9.99, 10
a = []
b = []
for t in time:
a.append(math.sin(t) * (math.exp(1)*math.cos(t) - 2*math.cos(4*t) - (math.sin(5*t/12)))) #it creates a list of x elements
b.append(math.cos(t) * (math.exp(1)*math.cos(t) - 2*math.cos(4*t) - (math.sin(5*t/12)))) #it creates a list of y elements

import matplotlib.pyplot as plt #module for plotting graph
x = a
y = b
print(plt.plot(x,y)) #plots the graph

#####

output:

[<matplotlib.lines.Line2D object at 0x0000013401D9C2B0>]

the above functions creates flower like structures

Add a comment
Know the answer?
Add Answer to:
Write a script called “faracha” that plots a vs. b as defined in the following equations:...
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