Question: 6. Write a function perimeter (poly) which finds the perimeter of a polygon, where the input argument poly is a list of tuples, each

6. Write a function perimeter (poly) which finds the perimeter of a

6. Write a function perimeter (poly) which finds the perimeter of a polygon, where the input argument poly is a list of tuples, each tuple being the (x, y) coordinates of a point on the polygon. The perimeter is the sum of the distances from one point to the next, including the distance from the last point to the first. The distance between (x1, y1) and (x2, y2) is: sqrt( (x2-x1) ** 2 + (y2-y1) ** 2) Try your function on a square, a rectangle, and a triangle, where you know what the answer should be.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure Heres an implementation of the perimeterpoly function in Python python import math def perimete... View full answer

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