NAME: cutpar
PURPOSE: cut p parallelogram(s) into p*n^2 parallelograms
CATEGORY: basic work
CALLING SEQUENCE:res = cutpar(x0, y0, x1, y1, x2, y2, x3, y3, n)
INPUTS:
x0,y0 1d arrays of p elements, giving the edge positions. The
edges must be given as in plot to traw the parallelogram. (see
example).
n: each parallelogram will be cutted in n^2 pieces
KEYWORD PARAMETERS:
/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.
OUTPUTS:
-defaut: 3d array(2,n^2,p) giving the center position of each
piece of the parallelograms
-/endpoints: 3d array(2,(n+1)^2,p) giving the edge positions
of each piece of the parallelograms
COMMON BLOCKS: no
SIDE EFFECTS: need cutsegment.pro
RESTRICTIONS: ?
EXAMPLE:
x0 = [2,6,2]
y0 = [0,2,6]
x1 = [3,8,4]
y1 = [4,4,6]
x2 = [1,6,4]
y2 = [5,6,8]
x3 = [0,4,2]
y3 = [1,4,8]
n = 4
splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata
for i=0,2 do oplot, [x0[i],x1[i],x2[i],x3[i],x0[i]],[y0[i],y1[i],y2[i],y3[i],y0[i]]
res=cutpar(x0, y0, x1, y1, x2, y2, x3, y3, n)
for i=0,2 do oplot, [res[0,*,i]], [res[1,*,i]], color = 20+10*i, psym = 1, thick = 3
MODIFICATION HISTORY: