08-19-2015 04:05 PM
I have a dataset of a 100 randomly generated xy coordinates. I'm trying isolate the points that are on the edge of the area. The definition of this would be:
if the xy coordinate has no x value from another point above it or
if the xy coordinate has no x value from another point below it or
if the xy coordinate has no y value from another point above it or
if the xy coordinate has no y value from another point above it
I'm looking for a reasonably efficient way of doing this.,
do i= 1 to 100;
x= round(1000* ranuni(123),1);
y= round(1000* ranuni(789),1);
08-19-2015 04:39 PM
I think you may need to provide some graphic examples of what you mean by coordinates that are on the "edge".
Same x but different y, or same y but different x seems to be the implied condition. But why would that make them an "edge"
If you have
( 5, 10)
( 5, 15)
which are "edge"?
08-19-2015 04:45 PM
All except (5,15). When I say edge I mean if you drew a line arounf all the outer points such that there were no points outside the shape the points joining the line would be on the edge. Like an efficient frontier.
08-19-2015 04:49 PM
It sounds like you are looking for the convex hull of the set of planar points. There is a convex hull algorithm in SAS/IML: