Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing And GRC Automation In SAP

Authors: Maxim Chuprunov

2013 Edition

3642434525, 978-3642434525

More Books

Students also viewed these Accounting questions

Question

What has been your desire for leadership in CVS Health?

Answered: 1 week ago

Question

Question 5) Let n = N and Y Answered: 1 week ago

Answered: 1 week ago