1 / 146

Contouring in C

Contouring in C. ATS 315. How Contours Really Work. Contours may LOOK like curves, but they are really just straight line segments. How Contouring Works:. How Contouring Works:. How Contouring Works:. How Contouring Works:. How Contouring Works:. How Contouring Works:.

Download Presentation

Contouring in C

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Contouring in C ATS 315

  2. How Contours Really Work • Contours may LOOK like curves, but they are really just straight line segments.

  3. How Contouring Works:

  4. How Contouring Works:

  5. How Contouring Works:

  6. How Contouring Works:

  7. How Contouring Works:

  8. How Contouring Works:

  9. How Contouring Works:

  10. How Contouring Works:

  11. How Contouring Works:

  12. How Contouring Works:

  13. How Contouring Works:

  14. How Contouring Works:

  15. How Contouring Works:

  16. How Contouring Works:

  17. How Contouring Works:

  18. How Contouring Works:

  19. How Contouring Works:

  20. How Contouring Works:

  21. How Contouring Works:

  22. How Contouring Works:

  23. How Contouring Works:

  24. How Contouring Works:

  25. How Contouring Works:

  26. How Contouring Works:

  27. So What We Are Really Worried About…

  28. So What We Are Really Worried About…

  29. So What We Are Really Worried About…

  30. The northwest corner is grid[i][j]. grid[i][j]

  31. The northwest corner is grid[i][j]. grid[i][j] grid[i][j+1] grid[i+1][j] grid[i+1][j+1]

  32. The northwest corner is grid[i][j]. grid[i][j] grid[i][j+1] grid[i+1][j] grid[i+1][j+1]

  33. How the contour is drawn depends on the value of the contour and the values at the four corners! grid[i][j] grid[i][j+1] grid[i+1][j] grid[i+1][j+1]

  34. For simplicity, rename the values at the corners: nw ne sw se

  35. Count the number of corners with values greater than the contour line. nw ne sw se

  36. CornersGreaterThanContour can be 0, 1, 2, 3, or 4. nw ne sw se

  37. if (CornersGreaterThanContour==0) do nothing nw ne sw se

  38. if (CornersGreaterThanContour==4) do nothing nw ne sw se

  39. if (CornersGreaterThanContour==1)… there are four possibilities: nw ne sw se

  40. if (CornersGreaterThanContour==1)… there are four possibilities: Possibility 1: Only the northwest corner is greater than the value of the contour. nw ne sw se

  41. if (CornersGreaterThanContour==1)… there are four possibilities: Possibility 2: Only the northeast corner is greater than the value of the contour. nw ne sw se

  42. if (CornersGreaterThanContour==1)… there are four possibilities: Possibility 3: Only the southeast corner is greater than the value of the contour. nw ne sw se

  43. if (CornersGreaterThanContour==1)… there are four possibilities: Possibility 4: Only the southwest corner is greater than the value of the contour. nw ne sw se

  44. if (CornersGreaterThanContour==2)… there are three possibilities: nw ne sw se

  45. if (CornersGreaterThanContour==2)… there are three possibilities: Possibility 1: The line should be drawn from the west edge to the east edge. Either: Both ne and nw are bigger than contour… or Both ne and nw are smaller than contour. nw ne sw se

  46. if (CornersGreaterThanContour==2)… there are three possibilities: Possibility 2: The line should be drawn from the north edge to the south edge. Either: Both ne and se are bigger than contour… or Both ne and se are smaller than contour. nw ne sw se

  47. if (CornersGreaterThanContour==2)… there are three possibilities: Possibility 3: Two contour lines pass through this box. Either: Both nw and se are bigger than contour… or Both nw and se are smaller than contour. nw ne sw se

  48. if (CornersGreaterThanContour==3)… there are four possibilities: nw ne sw se

More Related