home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20303 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.8 KB

  1. Xref: sparky comp.lang.c:20303 comp.lang.fortran:5221 sci.engr.mech:851
  2. Newsgroups: comp.lang.c,comp.lang.fortran,sci.engr.mech
  3. Path: sparky!uunet!ukma!gatech!asuvax!ncar!noao!stsci!stallcup
  4. From: stallcup@stsci.edu (Scott Stallcup)
  5. Subject: Re: Bilinear Interpolation ...
  6. Message-ID: <1993Jan28.145120.8494@stsci.edu>
  7. Sender: news@stsci.edu
  8. Organization: Space Telescope Science Institute
  9. X-Newsreader: TIN [version 1.1 PL6]
  10. References: <1993Jan27.173236.16488@cc.ic.ac.uk>
  11. Date: Thu, 28 Jan 1993 14:51:20 GMT
  12. Lines: 42
  13.  
  14. Mr G. Liran (gliran@.ic.ac.uk) wrote:
  15. : Hi,
  16. :     I am a student of Aeronautical Engineering and I need to write
  17. : a quick subroutine to do Bilinear Interpolation.  I have no idea how to 
  18. : do this and would greatly appreciate some help via e-mail or by post ...
  19.    Well, this is not a subroutine, but here is one approach to your
  20.    problem:
  21.  
  22.  
  23.    General equation for this function (in parametric matrix notation) :
  24.  
  25.       p(s,t) = [1-s  s] [a  d] [1-t]
  26.                         [b  c] [t  ]
  27.  
  28.    Where p is a 3D point as a function of s and t.
  29.    a, b, c, and d are the 3D vectors defining the "corner" points of the
  30.    four sided patch to be interpolated on.
  31.  
  32.    "s" should be in the domain: 0.0 to 1.0 in the direction of side "ab"
  33.    and "dc"
  34.  
  35.    "t" should be in the domain: 0.0 to 1.0 in the direction of side "ad"
  36.    and "bc"
  37.  
  38.    NOTE:  p(0,0) = a
  39.           p(0,1) = d
  40.           p(1,0) = b
  41.           p(1,1) = c
  42.  
  43.    HINT:  Draw youself a picture of four arbitrary points which form a
  44.           convex polygon in the plane.  Then label the points in clockwise
  45.           order from a to d.   The function does not require the points
  46.           to form a convex polygon (it's just easier to visualize).
  47.  
  48.    Hope this helps,
  49.  
  50.  -----------------------------------------------
  51.  Scott Stallcup             stallcup@stsci.edu
  52.  Space Telescope Science Institute
  53.  
  54.  
  55.