age Exercise 1: We consider a simple polygon P, which is defined by an ordered list...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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)! 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)!
Expert Answer:
Related Book For
College Algebra With Modeling And Visualization
ISBN: 9780134418049
6th Edition
Authors: Gary Rockswold
Posted Date:
Students also viewed these programming questions
-
NYS Paid Sick Leave law allows employees of organizations with 4 or fewer employees (and a net income of less than $1 million in the prior tax year) to take how many hours of leave per year?
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
Write a function my_ieee_2_dec(ieee), where icce is a string contains 64 char- acters of ones and zeros representing a 64-bit IEEE754 number. The output should be d, the equivalent decimal...
-
Assuming that the variation of pressure at the bottom of the pivot bearing is defined as p = p0(R2/r), determine the torque M needed to overcome friction if the shaft is subjected to an axial force...
-
In Problem determine whether the given set is finite or infinite. Consider the set Z of integers to be the universal set, and let E K M = {n e Z|n < 10} %3D K = {n e Z|n > 10'} E = {n e Z|n is even}
-
Figure 2.86 shows a scatterplot illustrating three different variables from the dataset HappyPlanetIndex. The variable Happiness is a measure of the well-being of a country, with larger numbers...
-
Assume all of the companys sales are on account. The accounts receivable balance at the beginning of the year was $512, and the ending balance was $481. During the year, the company had sales of...
-
Illinois Company prepared the following bank reconciliation at May 3 1 :Balance per bankAdditions:$ 1 , 2 9 5 Deposits in transitCheck incorrectly charged to our bank balanceDeductions: 2 5 8 1 0 2...
-
The hollow tube assembly rotates about a vertical axis with angular velocity = = 4 rad /s and = = 2 rad /s 2 . A small 0.2-kg slider P moves inside the horizontal tube portion under the control...
-
Describe how you could use social media (like LinkedIn) to make an existing professional contact more personal in nature while still maintaining your privacy.
-
You have $2,000 that you want to invest at the beginning of each of 5 years. The following alternatives are available to you: An investment that pays 7 percent for year 1, 6 percent for year 2, 5...
-
Catherine Valentine wants to start saving for retirement as soon as she gets a job upon graduation with an MS degree at age 24. She plans to deposit $1,500 at the end of her first year of work, at...
-
If you invest \($2\),000 today, \($3\),000 in 2 years, \($4\),000 in 5 years, and \($1\),000 in 7 years, how much will be in the bank 15 years from today if interest is 6 percent compounded annually?
-
A man lends $2,500 at 8 percent per year simple interest for 4 years. At the end of this time, he invests the entire amount (principal plus interest) at 6 percent compounded annually for 9 years. How...
-
Based on Exhibit 1 and Wakuluks assumptions about short-term rates and expected inflation, short-term rates in Country X are most likely to be: A. low and bottoming. B. approaching a peak. C. above...
-
ocation. 1 pt What is the difference between an outcome and an event? Choose the correct answer below 18 of 20 (3 complete) A. An event is the result of a single probability experiment. An outcome...
-
The nitrogen atoms in N2 participate in multiple bonding, whereas those in hydrazine, N2H4, do not. (a) Draw Lewis structures for both molecules. (b) What is the hybridization of the nitrogen atoms...
-
Solve each equation and inequality. Use interval notation. (b) (x - 1)(1)-(x + 1)(2x) (x - 1) (x - 1)(1)-(x + 1)(2x) (x - 1) = 0 >0
-
Write the given expression in the form f(x) = a(x - h) 2 + k. Identify the vertex. f(x) = 3x + 6x + 2
-
Let a, denote a ij the general term for the matrix A. Find each of the following. (a) a1 + a22 (b) a1 - 2023
-
Identify something you own, perhaps even something you still use regularly. a. Give a list of at least six reasons why you might consider replacing the identified item. b. Identify at least two...
-
A company owns a 6-year-old gear hobber that has a book value of \($60,000.\) The present market value of the hobber is \($80,000.Anew\) gear hobber can be purchased for \($450,000.\) Using an...
-
Ten reasons why companies use equipment long after replacements would be justified economically. In many cases, these reasons do not apply just to companies; rather, they apply to us as individuals....
Study smarter with the SolutionInn App