HW#4 --- last modified February 17 2019 19:41:14..
Solution set.
Due date: May 2
Files to be submitted:
Hw1.zip
Purpose: To learn about Voronoi Diagrams and Delauney Triangulation.
Related Course Outcomes:
The main course outcomes covered by this assignment are:
(9) Implement Voronoi diagrams and Delaunay triangulations
Specification:
For this homework you will write a program which reads in a set of 2D points from a file and then draws
either the Voronoi Diagram for those points or the Delauney Triangulation of those points.
The file name should be an easily identifiable constant at the start of your program. The file format
should look like:
diagram_type
x1, y1
x2, y2
...
Here diagram_type is either V for Voronoi diagram or D for Delauney Triangulation. The values xi,yi
are the floating point coordinates of the ith point in the set of points you are using to calculate
the given diagram. You should include some sample files with the assignment you turn in.
After reading in the file I want you to compute a rectangle [xmin, xmax] x [ymin, ymax] based on
the largest and smallest x and y values amongst the points you read in. Compute the center of this
rectangle. Draw your diagram within the rectangle with the same center but of x dimension 1.5*(xmax - xmin)
and y dimension 1.5*(ymax-ymin).
Point Breakdown
Department Coding Guidelines for C++ followed |
1pt
|
Program reads in files of the above format correctly |
2pts
|
Output drawn to rectangle of positioned and sized as described above |
1pt
|
Program draws the Voronoi diagram of the points from the file clipped to the rectangle
of the previous point. Edges and vertices should be clearly indicated |
3pts
|
Program draws the Delauney Triangulation of the points from the file clipped to the rectangle.
Edges and vertices should be clearly indicated |
3pts
|
Total | 10pts |
|