Question: PLEASE WRITE IN PYTHON ASAP. THANK YOU !!! Matplotlib Application Write a function cylinder (radius, height) that generates a 3D cylinder using a contour map.

 PLEASE WRITE IN PYTHON ASAP. THANK YOU !!! Matplotlib Application Write

PLEASE WRITE IN PYTHON ASAP. THANK YOU !!!

Matplotlib Application Write a function cylinder (radius, height) that generates a 3D cylinder using a contour map. Your function should work with the following code: The program should produce two cylinders. For simplicity, you can draw a cylinder in one figure (window), so after closing the window, another window with a new figure appears. The first cylinder height is 2 units, and its radius is 1 unit. The second cylinder height is 10 units, and its radius is 2 units. You need to use the NumPy meshgrid method to generate coordinates for the contour map similar to how you did in lab 5. You can check our Google Colab CSE30 Python Abstractions.ipynb - Colaboratory (google.com) G for guidance on how to create a 3D plot. The first cylinder should look like the following picture: Hints: you can calculate x and y coordinates using the following equations: x=radiusnpcos(theta)y=radiusnp.sin(theta) where theta is an angle used as a parameter in the polar coordinate system. For one contour, theta can be calculates as theta =np.linspace(0, 2np.pi, 100). Remember to use a meshgrid to create other contours. Matplotlib Application Write a function cylinder (radius, height) that generates a 3D cylinder using a contour map. Your function should work with the following code: The program should produce two cylinders. For simplicity, you can draw a cylinder in one figure (window), so after closing the window, another window with a new figure appears. The first cylinder height is 2 units, and its radius is 1 unit. The second cylinder height is 10 units, and its radius is 2 units. You need to use the NumPy meshgrid method to generate coordinates for the contour map similar to how you did in lab 5. You can check our Google Colab CSE30 Python Abstractions.ipynb - Colaboratory (google.com) G for guidance on how to create a 3D plot. The first cylinder should look like the following picture: Hints: you can calculate x and y coordinates using the following equations: x=radiusnpcos(theta)y=radiusnp.sin(theta) where theta is an angle used as a parameter in the polar coordinate system. For one contour, theta can be calculates as theta =np.linspace(0, 2np.pi, 100). Remember to use a meshgrid to create other contours

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 Accounting Questions!