Answered step by step
Verified Expert Solution
Question
1 Approved Answer
age Exercise 1: We consider a simple polygon P, which is defined by an ordered list of points. As an example one could consider
age Exercise 1: We consider a simple polygon P, which is defined by an ordered list of points. As an example one could consider the following list of points ((0,0), (1,0), (1, 1), (0, 1)), which represents the unit square. a) Implement an O(n) algorithm for the calculation of the area enclosed by the polygon P. b1) Implement an algorithm that computes the convex hull of a polygon P! b2) Implement an algorithm in order to check whether a given polygon P is convex! Use an efficient algorithm. c) Implement an algorithm to check, whether a given line intersects a given polygon P. Hint: Use Greens theorem for a)! Test your code for at least two different examples and choose them wisely (such that the tests are meaningful). I) Describe an algorithm that computes the area of a general polygon (with holes and self-intersections)!
Step by Step Solution
★★★★★
3.46 Rating (149 Votes )
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