Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Let x and y be column vectors describing the vertices of a polygon, given in order. Write functions polyperim(x,y) and polyarea(x,y) that compute the perimeter
Let x and y be column vectors describing the vertices of a polygon, given in order. Write functions polyperim(x,y) and polyarea(x,y) that compute the perimeter and area of a polygon. For the area, use a formula based on Green's theorem:
in this theorem k = 1.
Here n is the number of polygon vertices, and by definition, xn+1 = x1 and yn+1 = y1. Test your functions on a square and an equilateral triangle.
1/2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started