Contouring in C

# Contouring in C

## Contouring in C

- - - - - - - - - - - - - - - - - - - - - - - - - - - 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. Count the number of corners with values greater than the contour line. nw ne sw se

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

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

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

38. 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

39. 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

40. 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

41. 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

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

43. 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

44. 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

45. 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

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