## Determine relevancy and relative position of two polygons, Data Structure & Algorithms

Assignment Help:

Comparison Techniques

There are several techniques for determining the relevancy and relative position of two polygons. Not all tests may be used with all hidden-surface algorithms, and some of the are not always conclusive. Sometimes we can use simple tests for many of the cases and resort to more costly tests only when all else fails.

One technique that is often useful is called the minimax test or boxing test. This test checks if two polygons overlap. The test provides a quick method to determine if two polygons do not overlap. It surrounds each polygon with a box by finding its extents (minimum and maximum x and y coordinates) and then checks for the intersection for any two boxes in both the X and Y directions. If two boxes do not intersect, their corresponding polygons do not overlap. In such a case, no further testing of the edges of the polygons is required.

If the minimax test fails (two boxes intersect), the two polygons may or may not overlap, as shown in Figure 3.10. Each edge of one polygon is compared against all the edges of the other polygon to detect intersections. The minimax test can be applied first to any two edges to speed up this process.

The minimax test can be applied in the Z direction to check if there is no overlap in this direction. In all tests, finding the extents themselves is the most critical part of the test. Typically, this can be achieved by iterating through the list of vertex coordinates of each polygon and recording the largest and the smallest values for each coordinate. #### Algorithm for binary search, Q. Write down the algorithm for binary search....

Q. Write down the algorithm for binary search. Which are the conditions under which sequential search of a list is preferred over the binary search?

#### Estimate the probability that the noncritical path , An advertising project...

An advertising project manager developed the network diagram shown below for a new advertising campagign.  In addition, the manager gathered the time information for each activity,

#### Define midsquare method, Midsquare Method :- this operates in 2 steps. In t...

Midsquare Method :- this operates in 2 steps. In the first step the square of the key value K is taken. In the 2nd step, the hash value is obtained by deleting digits from ends of

#### Algorithmic implementation of multiple stacks, So far, we now have been con...

So far, we now have been concerned only with the representation of single stack. What happens while a data representation is required for several stacks? Let us consider an array X

#### Design a doubly linked list, Instructions : You have to design a dou...

Instructions : You have to design a doubly linked list container. The necessary classes and their declarations are given below The main() function for testing the yo

#### Advanced data structures, In this unit, the following four advanced data st...

In this unit, the following four advanced data structures have been practically emphasized. These may be considered as alternative to a height balanced tree, i.e., AVL tree.

#### Define the term ''complexity of an algorithm, Define the term 'complexity o...

Define the term 'complexity of an algorithm; Complexity of an algorithm is the calculate of analysis of algorithm. Analyzing an algorithm means predicting the resources that th

#### State the ruby programming language, The Ruby Programming Language Alth...

The Ruby Programming Language Although data structures and algorithms we study aren't tied to any program or programming language, we need to write particular programs in speci

#### Non Recursive Algorithm to Traverse a Binary Tree, Q. Write down a non recu...

Q. Write down a non recursive algorithm to traverse a binary tree in order.                    Ans: N on - recursive algorithm to traverse a binary tree in inorder is as

#### A full binary tree with 2n+1 nodes, A full binary tree with 2n+1 nodes have...

A full binary tree with 2n+1 nodes have n non-leaf nodes  