Changeset 101 for trunk/SRC/Interpolation/inquad.pro
- Timestamp:
- 06/12/06 10:29:56 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/inquad.pro
r59 r101 1 1 ;+ 2 ; NAME:inquad 3 ; 4 ; PURPOSE: to find if an (x,y) point is in a quadrilateral (x1,x2,x3,x4) 5 ; 6 ; CATEGORY:grid manipulation 7 ; 8 ; CALLING SEQUENCE: 2 ; @file_comments to find if an (x,y) point is in a quadrilateral (x1,x2,x3,x4) 3 ; 4 ; @categories grid manipulation 5 ; 6 ; @examples 9 7 ; 10 8 ; res = inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4) 11 9 ; 12 ; INPUTS: 13 ; 14 ; x,y: the coordinates of the point we want to know where it 10 ; @param x y {in}{required} the coordinates of the point we want to know where it 15 11 ; is. Must be a scalar if /onsphere activated else can be scalar 16 12 ; or array. 17 13 ; 18 ; x1, y1, x2, y2, x3, y3, x4, y4:the coordinates of the14 ; @param x1 y1 x2 y2 x3 y3 x4 y4 {in}{required} the coordinates of the 19 15 ; quadrilateral given in the CLOCKWISE order. Scalar or array. 20 16 ; 21 ; KEYWORD PARAMETERS: 22 ; 23 ; /DOUBLE: use double precision to perform the computation 24 ; 25 ; /ONSPHERE: to specify that the quadilateral are on a sphere and 17 ; 18 ; @keyword /DOUBLE use double precision to perform the computation 19 ; 20 ; @keyword /ONSPHERE to specify that the quadilateral are on a sphere and 26 21 ; that teir coordinates are longitude-latitude coordinates. In this 27 22 ; case, est-west periodicity, poles singularity and other pbs … … 29 24 ; automatically. 30 25 ; 31 ; ZOOMRADIUS:the zoom (circle centred on the (x,y) with a radius of26 ; @keyword ZOOMRADIUS :the zoom (circle centred on the (x,y) with a radius of 32 27 ; zoomradius degree where we look for the the quadrilateral which; contains the (x,y) point) used for the satellite projection 33 28 ; when /onsphere is activated. Default is 4 and seems to be the … … 35 30 ; larger than 5 degrees. 36 31 ; 37 ; /NOPRINT: to suppress the print messages. 38 ; 39 ; OUTPUTS: 40 ; 41 ; res, a n element vector. Where n is the number of elements of 32 ; @keyword /NOPRINT to suppress the print messages. 33 ; 34 ; @returns 35 ; a n element vector. Where n is the number of elements of 42 36 ; x. res[i]=j means that the point number i is located in the 43 37 ; quadrilateral number j with (0 <= j <= n_elements(x0)-1) 44 38 ; 45 ; COMMON BLOCKS:none 46 ; 47 ; SIDE EFFECTS: 48 ; 49 ; RESTRICTIONS: I think degenerated quadrilateral (e.g. flat of 39 ; @restrictions I think degenerated quadrilateral (e.g. flat of 50 40 ; twisted) is not work. This has to be tested. 51 41 ; 52 ; EXAMPLE:42 ; @examples 53 43 ; 54 44 ; x = 1.*[1, 2, 6, 7, 3] … … 69 59 ; On a sphere see clickincell.pro... 70 60 ; 71 ; MODIFICATION HISTORY:72 ; Sebastien Masson (smasson @lodyc.jussieu.fr)61 ; @history 62 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 73 63 ; August 2003 74 64 ; Based on Convert_clic_ij.pro written by Gurvan Madec … … 192 182 ; the point is inside the quadilateral if test eq 1 193 183 ; with test equal to: 194 ; test = ((x-x1)*(y2-y1) GE (x2-x1)*(y-y1)) $ 184 ; test = ((x-x1)*(y2-y1) GE (x2-x1)*(y-y1)) $ 195 185 ; *((x-x2)*(y3-y2) GT (x3-x2)*(y-y2)) $ 196 186 ; *((x-x3)*(y4-y3) GT (x4-x3)*(y-y3)) $
Note: See TracChangeset
for help on using the changeset viewer.