set.seed(12)
X = runif(10, 1, 100)
Y = runif(10, 1, 100)
hc = chull(X, Y)
#### looks like chull returns points in clockwise
L = list(x=X[hc] , y=Y[hc] )
j1 = jarea(L )
######### reverse order of polygon
jc = rev(hc)
L = list(x=X[jc] , y=Y[jc] )
j2 = jarea(L )
Run the code above in your browser using DataLab