Changeset 125 for trunk/SRC/Interpolation/cutsegment.pro
- Timestamp:
- 07/06/06 16:10:25 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/cutsegment.pro
r121 r125 1 1 ;+ 2 2 ; 3 ; @file_comments cut p segments into p*n equal parts 3 ; @file_comments 4 ; cut p segments into p*n equal parts 4 5 ; 5 6 ; @categories basic work … … 13 14 ; @param n {in}{required} the number of pieces we want to cut each segment 14 15 ; 15 ; @keyword /endpointssee ouputs16 ; @keyword ENDPOINTS see ouputs 16 17 ; 17 ; @keyword /onsphereto specify that the points are located on a18 ; @keyword ONSPHERE to specify that the points are located on a 18 19 ; sphere. In this case, x and y corresponds to longitude and 19 20 ; latitude in degrees. 20 21 ; 21 22 ; @returns 22 ; 23 ; 24 ; if /endpoints, a 3d array (2,n+1,p) that gives the25 ; 23 ; - default: a 3d array (2,n,p) that gives the coordinates of the 24 ; middle of the cutted segments. 25 ; - if /ENDPOINTS, a 3d array (2,n+1,p) that gives the 26 ; coordinates of the endpoints of the cutted segments. 26 27 ; 27 ; @examples 28 ; @examples 28 29 ; 29 ; 30 ; 31 ; 32 ; 33 ; 34 ; 35 ; 36 ; 37 ; 38 ; 30 ; IDL> x0=[2,5] 31 ; IDL> y0=[5,1] 32 ; IDL> x1=[9,3] 33 ; IDL> y1=[1,8] 34 ; IDL> res=cutsegment(x0, y0, x1, y1, 10) 35 ; IDL> splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata 36 ; IDL> oplot, [x0[0], x1[0]], [y0[0], y1[0]] 37 ; IDL> oplot, [res[0,*,0]], [res[1,*,0]], color = 20, psym = 1, thick = 3 38 ; IDL> oplot, [x0[1], x1[1]], [y0[1], y1[1]] 39 ; IDL> oplot, [res[0,*,1]], [res[1,*,1]], color = 40, psym = 1, thick = 3 39 40 ; 40 41 ; @history … … 45 46 ; 46 47 ;- 47 FUNCTION cutsegment, x0, y0, x1, y1, n, endpoints = endpoints, onsphere= onsphere48 FUNCTION cutsegment, x0, y0, x1, y1, n, ENDPOINTS = endpoints, ONSPHERE = onsphere 48 49 ; 49 50 compile_opt idl2, strictarrsubs 50 51 ; 51 52 ; number of segment 52 nseg = n_elements(x0) 53 nseg = n_elements(x0) 53 54 ; number of point to find on each segment 54 n2find = n+keyword_set(endpoints) 55 n2find = n+keyword_set(endpoints) 55 56 ; 56 57 IF keyword_set(onsphere) THEN BEGIN
Note: See TracChangeset
for help on using the changeset viewer.