Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Python 3.0 to write the function find_convex_cover(pvertices,clist) that takes input pvertices which is a (n1)(n1)-long iterable of polygon vertices and clist is a list

Use Python 3.0 to write the function find_convex_cover(pvertices,clist) that takes input pvertices which is a (n1)(n1)-long iterable of polygon vertices and clist is a list of (xi,yi)(xi,yi) tuples of circle-centers. The output is the find_convex_cover which is a mm long list of radii, riri, corresponding to the mm circle-centers.

image text in transcribed

Convex Cover Given a irregular, closed, convex polygon with n - 1 sides and m circle-centers {(ti, yi)}contained within that polygon, compute the radii, 0 >> pvertices = array([[ 0.573, 0.797], [ 0.688, 0.402], [ 0.747, 0.238], [ 0.802, 0.426], [ 0.757, 0.796), [ 0.589, 0.811]]) >>> clist = [(0.7490863467660889, 0.4917635308023209), (0.6814339441396109, 0.6199470305156477), (0.7241617773773865, 0.6982813914515696), (0.6600700275207232, 0.7516911829987891), (0.6315848053622062, 0.7730550996176769), (0.7348437356868305, 0.41342916986639894), (0.7597683050755328, 0.31729154508140384)] >>> find_convex_cover(pvertices, clist) # note some radii == 0 [0, 0, 0.10297280518543134, 0, 0.06374182913818943, 0.0684588720095565, 0.07987784828713643] Hints: m can be very large so use Numpy broadcasting effectively. For your own understanding, use Matplotlib to visualize the polygons and circles. Numpy is the only third-party module you can use with this assignment. Since the n-polygon is closed, the first and last vertices are the same so that only n Your solution can be an approximation to the minimum. 1 vertices need be specified. Convex Cover Given a irregular, closed, convex polygon with n - 1 sides and m circle-centers {(ti, yi)}contained within that polygon, compute the radii, 0 >> pvertices = array([[ 0.573, 0.797], [ 0.688, 0.402], [ 0.747, 0.238], [ 0.802, 0.426], [ 0.757, 0.796), [ 0.589, 0.811]]) >>> clist = [(0.7490863467660889, 0.4917635308023209), (0.6814339441396109, 0.6199470305156477), (0.7241617773773865, 0.6982813914515696), (0.6600700275207232, 0.7516911829987891), (0.6315848053622062, 0.7730550996176769), (0.7348437356868305, 0.41342916986639894), (0.7597683050755328, 0.31729154508140384)] >>> find_convex_cover(pvertices, clist) # note some radii == 0 [0, 0, 0.10297280518543134, 0, 0.06374182913818943, 0.0684588720095565, 0.07987784828713643] Hints: m can be very large so use Numpy broadcasting effectively. For your own understanding, use Matplotlib to visualize the polygons and circles. Numpy is the only third-party module you can use with this assignment. Since the n-polygon is closed, the first and last vertices are the same so that only n Your solution can be an approximation to the minimum. 1 vertices need be specified

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

10-7 How will MIS help my career?

Answered: 1 week ago