You are on page 1of 2

Untitled99.ipynb - Colaboratory https://colab.research.google.com/drive/13ij7WCLKb52hWszrzzugH9...

1 import numpy as np
2 import matplotlib.pyplot as plt
3 x=np.linspace(0,5*np.pi,100)
4 f=np.cos(x)-(5*np.sin(x)/x)
5 g=np.ones(100)
6 plt.plot(x,f)
7 plt.plot(x,g)
8 print(np.interp(0,f,x))

15.707963267948966
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:4: RuntimeWarning: inva
after removing the cwd from sys.path.

1 import numpy as np
2 import matplotlib.pyplot as plt
3 x=np.zeros(100)
4 y=np.zeros(100)
5 t=np.linspace(0,10,100)
6 b=1
7 gamma=2
8 x=b*((np.cos(-gamma*t)))
9 y=(b/2.0)*((np.cos(-2*gamma*t)))
10 plt.plot(x,y)
11 plt.title("trajectory q7 a")
12 plt.xlabel('x')
13 plt.ylabel('y')
14 plt.savefig("q7.png")

1 of 2 10/31/2020, 6:17 PM
Untitled99.ipynb - Colaboratory https://colab.research.google.com/drive/13ij7WCLKb52hWszrzzugH9...

2 of 2 10/31/2020, 6:17 PM

You might also like