Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using MATLAB 17. As shown in the figure, the area of a convex polygon can be calculated by adding the area of the triangles that

Using MATLAB image text in transcribed
17. As shown in the figure, the area of a convex polygon can be calculated by adding the area of the triangles that the polygon can be divided into. Write a user G defined MATLAB function that calculates the area of a convex n-sided polygon. For the function name H and arguments, use A = APolygon (Crd). The input argument Crd is a two-column matrix where each row contains the coordinates of a vertex (first column is the x coordi- nate and the second column is the y coordinate). The vertices are listed in the order that they are connected to form the polygon (i.e., coordinates of point A in the first row, point B in the second, and so on). The output argu- ment A is the area of the polygon. Write the code of APolygon such that it has a subfunction that calculates the area of a triangle for given vertices' coordinates. Use APolygon to calculate the area of the polygon shown in the figure. The coordinates of the vertices are: A(1, 1), B(7, 2), C(10, 5), D(9, 11), E(6, 12), F1, 12), G(-3, 8), H(-4, 4)

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago