Assignment 9

Early submission credit

If you choose to submit the assignments early, you will be given extra credit at the rate of 1% extra credit per day of early submission.

Description

In this assignment, you will implement Marching Squares, one algorithm for generating contours of a 2D scalar field. We will use the same data as in assignment 6, the dataset with temperature and pressure measurements for a simulation of Hurricane Isabel. As usual, you will build on skeleton code we provide.

Data

The data is provided in two arrays: temperatureCells and pressureCells. Each array contains objects that look like this:

{
    NW: value-at-nw-corner,
    NE: value-at-ne-corner,
    SW: value-at-sw-corner,
    SE: value-at-se-corner,
    Row: i,
    Col: j
}

Part 1: Implement the computation of outlines contours (50 points)

Implement the computation of outline contours using marching squares by filling out the skeleton code, specifically the function generateOutlineContour. As in assignment 4, each square is 10x10 pixels.

The solution will look like this:

contour outlines

Part 2: Implement the computation of filled contours (50 points)

Implement the computation of filled contours using marching squares by filling out the skeleton code, specifically the functions generateFilledContour and includesFilledContour. As in assignment 4, each square is 10x10 pixels.

The solution will look somewhat like this:

filled contours

Files

Hints