Question: Please write code in Matlab or Octave! 1 of 2 Engineering Modeling and Design Dr. Ashuri Lab Assignment 4 Problem 1: One of the most

Please write code in Matlab or Octave! Please write code in Matlab or Octave! 1 of 2 Engineering Modeling

1 of 2 Engineering Modeling and Design Dr. Ashuri Lab Assignment 4 Problem 1: One of the most important mathematical problems through all times has been to find the area of a polygon, especially because real estate areas often had the shape of polygons, and it was necessary to pay tax for the area. We have a polygon as depicted below. The vertices ("corners") of the polygon have coordinates (x, y), (x2. Y), ..., (x, y), numbered either in a clockwise or counter clockwise fashion. The area A of the polygon can amazingly be computed by just knowing the boundary coordi- nates: (x1 + xy + ... + xy + xy) -(yx2 + y2x3 + ... + Yn-1X + Yn 1) Write a function polyarea(x, y) that takes two coordinate arrays with the ver- tices as arguments and returns the area. Assume that x and y are either lists or arrays. Test the function on a triangle, a quadrilateral, and a pentagon where you can calculate the area by alternative methods for comparison Filename: polyarea.m

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