Question: Question 3 ( 3 points ) The following Python code plots i = 1 e s 1 2 on the interval 0 < = s

Question 3(3 points)
The following Python code plots i =1 e
s1
2 on the interval 0<= s <=1. It
plots a red dashed line, adds a label in a legend, and uses half of the figure (one
subplot out of two).
import numpy as np
import matplotlib.pyplot as plt
s = np.linspace(0,1,2**7)
i =1- np.exp(s -0.5)
plt.subplot(1,2,1)
plt.plot(s, i,"r--", label="i")
plt.legend()
plt.xlabel(s)
plt.show()
a) On the same subplot, plot j = s
2
1
4
and k =
1
s+1. Make sure all values
are labeled and easily distinguishable from one another.
b) The given values of i(s), j(s), k(s) are Cartesian coordiates of an object
as a function of s. On the same subplot, plot also the radial distance of the
object from the k axis and the radius of the object from the origin.
c) On a second subplot, plot the azimuth (from the i axis) and the elevation
(from the k axis) of the object. Make sure all values are labeled and easily
distinguishable from one another.
Hint: read about np.arctan2 and np.arccos functions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!