How to make the triangle-selection process faster

Assignment Help Basic Computer Science
Reference no: EM131353318

(a) Write a WPF program that uses the method in Exercise 32.6 to generate points in a triangle. The user should be able to drag the three triangle vertices, and press buttons to generate either a single point or 100 points, each of which should be displayed as a colored dot within the triangle. Another button should clear the points.

(b) Extend your program to handle meshes. Generate a 2D mesh (perhaps the Delaunay triangulation for a random set of points), and then improve your program to pick a point (or 100 points) in the mesh uniformly at random. Do so by precomputing the triangle areas, summing them, and then assigning each triangle a probability given by its area divided by the total area. Put the triangles in some order, and compute probability sums s[0] = p[0], s[1] = p[0] + p[1], s[2] = p[0] + p[1] + p[2], etc. Given a uniform random variable u, you can now identify the largest index i with u ≤ s[i]. To generate a random mesh point, you can pick a uniform random number u, identify the last triangle i with u ≤ s[i], and then generate a random point in that triangle (see Exercise 32.6).

(c) Briefly discuss how to make the triangle-selection process faster than O(n), where n is the number of triangles in the mesh.

(d) Suppose that in ordering the triangles, we place the largest ones first. Then in a search of the list, we're likely to examine relatively few triangles to find the "right" one. Would you, in working with a typical graphics model, expect this to have a large impact on the sampling time? Why or why not?

Reference no: EM131353318

Questions Cloud

Multiplication of numbers which are less than its bases : multiplication of numbers which are less than its bases.
How to generate uniform random points in the unit square : Show that for any triangle PQR, the points uP + vQ + wR are distributed uniformly at random in the triangle, when uvw are generated according to part (c).
Find time required the pressure to decrease : The bulb contains water vapor originally at a pressure of 13.3Pa. Assuming that every water molecule that enters the appendix condenses on the wall and stays there, find the time required for the pressure to decrease to 1.33 x 10-4 Pa.
Heart and differentiate between pulmonary : Trace the pathway of the blood through the heart and differentiate between pulmonary, systemic, and cardiac circulation.
How to make the triangle-selection process faster : Suppose that in ordering the triangles, we place the largest ones first. Then in a search of the list, we're likely to examine relatively few triangles to find the "right" one. Would you, in working with a typical graphics model, expect this to ha..
Create an argument to be presented to the leaders : Create an argument to be presented to the leaders with the organization that a strategic plan is essential for the IM / IT. Indicate the most significant elements that the administrator should address in the plan. Provide support for the rationale..
Plot your forecast on the same graph as the original data : Starting in year 4 and going to year 12, forecast demand using a 3-year moving average. Plot your forecast on the same graph as the original data
Analyze what is meant by religion : A world view is a fundamental or basic orientation of thinking - like a mindset - which guides a culture and / or a person's life. Like a point of view, it can be built of concepts, ideas, values, emotions, and ethics. Weltanschauung is the German..
Compute the variance of your estimate : When, qualitatively, would you expect the variance to be larger than that of the preceding problem's estimator? When would you expect it to be lower?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd