home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / programm / 2518 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  2.1 KB

  1. Path: sparky!uunet!bcstec!aw108!gcr8829
  2. From: gcr8829@aw2.fsl.ca.boeing.com (Gustav C. Rettke)
  3. Newsgroups: comp.programming
  4. Subject: Re: Help - Contour drawing algorithm needed
  5. Message-ID: <1992Aug27.224841.9915@aw2.fsl.ca.boeing.com>
  6. Date: 27 Aug 92 22:48:41 GMT
  7. References: <1992Aug27.210308.9621@aw2.fsl.ca.boeing.com>
  8. Organization: fsl
  9. Lines: 71
  10.  
  11. From article <1992Aug27.210308.9621@aw2.fsl.ca.boeing.com>, by gcr8829@aw2.fsl.ca.boeing.com (Gustav C. Rettke):
  12. > From article <1992Aug25.165307.21995@tamsun.tamu.edu>, by tpradeep@cs.tamu.edu (Pradeep K Tapadiya):
  13. >> 
  14. >> Howdy netters,
  15. >> 
  16. >> Given a set of (x,y,t) points where (x,y) represent the cooridinate and
  17. >> (t) represents the associated temperature, I need to draw temperature
  18. >> contours over a specified region. Can someone suggest me an algorithm
  19. >> to do this, or refer me to the right book(s).
  20. >> 
  21. >> Thank you for your help.
  22. >> 
  23. >> Pradeep
  24. >> tpradeep@cs.tamu.edu
  25. > Here's a simple alogrithm:
  26. >     For y = y1 to y2
  27. >       For x = x1 to x2
  28. >         Calculate t
  29. >         Set xplot = x
  30. >         Set yplot = t + k * y
  31. >         Plot xplot, yplot
  32. >           Next x
  33. >         Next y
  34. > Where k is an obliqueness factor.
  35. > This will produce a view as if you were standing above the x,y-plane.  The
  36. > factor k affects the degree of above (or below) the plane.  Play with k to get
  37. > a good perspective.
  38. > Another enhancement might be to connect line segments to produce 'lines of
  39. > constant x'.  Here's the algorithm with the slight modifications.
  40.           \_____________________________
  41. >                                       \ 
  42. >     For y = y1 to y2                  Correction, that should be lines
  43. >                                           of constant y.
  44. >       For x = x1 to x2-1                            -
  45. >         Calculate t1 @ x
  46. >             Calculate t2 @ x+1
  47. >         Set xp1 = x
  48. >         Set xp2 = x+1
  49. >         Set yp1 = t1 + k * y
  50. >             Set yp2 = t2 + k * y
  51. >         Line   xp1, yp1   to   xp2, yp2
  52. >           Next x
  53. >         Next y
  54. > Of course you will have to massage the scaling and resolution.
  55. > Hope this helps.
  56. > G Rettke
  57.