topinquad grid manipulation
Return value
a n element vector. Where n is the number of elements of
x. res[i]=j means that the point number i is located in the
quadrilateral number j with (0 <= j <= n_elements(x0)-1)
Parameters
x
in
required
y
x1
in
required
y1
x2
y2
x3
y3
x4
y4
Keywords
ONSPHERE
DOUBLE
ZOOMRADIUS
NOPRINT
NEWCOORD
Examples
res = inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4)
x = 1.*[1, 2, 6, 7, 3]
y = 1.*[1, 3, 3, 4, 7]
x1 = 1.*[0,4,2]
y1 = 1.*[1,4,8]
x2 = 1.*[1,6,4]
y2 = 1.*[5,6,8]
x3 = 1.*[3,8,4]
y3 = 1.*[4,4,6]
x4 = 1.*[2,6,2]
y4 = 1.*[0,2,6]
splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata
for i=0,2 do oplot, [x4[i],x1[i],x2[i],x3[i],x4[i]],[y4[i],y1[i],y2[i],y3[i],y4[i]]
oplot, x, y, color = 20, psym = 1, thick = 2
print, inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4)
On a sphere see clickincell.pro...
Version history
History
Sebastien Masson (smasson@lodyc.jussieu.fr)
August 2003
Based on Convert_clic_ij.pro written by Gurvan Madec
Known issues
Restrictions
I think degenerated quadrilateral (e.g. flat of
twisted) is not work. This has to be tested.