README - while loop to search for the next shortest point...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Kham Lee CS 130b Project 2 1. Pseudo-code algorithm declare needed varibles read in upper plane points and store them in an Point array1 read in lower plane points and store them in Point array2 for ( i =0; i < m; i++) { for (j = 0; j < m; j++) compare each upper layer point to lower to find the shortest distance points (upper and lower) } while total triangles != m+n triangles { while loop to search for the next shortest point to the current (upper) point in the upper layer if these two points already form a base then use the next shortest distance form triangle from the two found upper points and the one lower
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: while loop to search for the next shortest point tothe current (lower) point in the lower layer if these two points already form a base then use the next shortest distance when point is found, compare the two distance of that point to the two previous upper points form the triangle } The time complexity of this algorithm is O(m*n). 2. I made it to search for the nearest point in the upper or lower plane without having two triangles using the same base. 3. Mine does not always generate the optimal triangulation because it failed some test cases....
View Full Document

This note was uploaded on 02/19/2012 for the course ENGR 361 taught by Professor Drexel during the Spring '12 term at Bloomsburg.

Ask a homework question - tutors are online