<<prev file | next file >>    view single page | view frames    summary: fields | routine    details: routine

Interpolation/

cutsegment.pro

cut p segments into p*n equal parts

topcutsegment basic work

result = cutsegment(x0, y0, x1, y1, n, ENDPOINTS=ENDPOINTS, ONSPHERE=ONSPHERE)

Return value

- default: a 3d array (2,n,p) that gives the coordinates of the middle of the cut segments. - if /ENDPOINTS, a 3d array (2,n+1,p) that gives the coordinates of the endpoints of the cutted segments.

Parameters

x0        in required

y0        in required

x1        in required

y1        in required

1d arrays of p elements, the coordinates of the endpoints of the p segments

n        in required

the number of pieces we want to cut each segment

Keywords

ENDPOINTS       

see outputs

ONSPHERE       

to specify that the points are located on a sphere. In this case, x and y corresponds to longitude and latitude in degrees.

Examples

IDL> x0=[2,5] IDL> y0=[5,1] IDL> x1=[9,3] IDL> y1=[1,8] IDL> res=cutsegment(x0, y0, x1, y1, 10) IDL> splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata IDL> oplot, [x0[0], x1[0]], [y0[0], y1[0]] IDL> oplot, [res[0,*,0]], [res[1,*,0]], color = 20, psym = 1, thick = 3 IDL> oplot, [x0[1], x1[1]], [y0[1], y1[1]] IDL> oplot, [res[0,*,1]], [res[1,*,1]], color = 40, psym = 1, thick = 3

Version history

Version

$Id: cutsegment.pro 136 2006-07-10 15:20:19Z pinsard $

History

S. Masson (smasson@lodyc.jussieu.fr) July 5th, 2002

Statistics

McCabe cyclic 3
McCabe essential 1
McCabe modular design 1
Produced by IDLdoc 2.0.