## Finding the perimeter points of an area of points.

Super Contributor
Posts: 259

# Finding the perimeter points of an area of points.

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.,

data obs;

do i= 1 to 100;

x= round(1000* ranuni(123),1);

y= round(1000* ranuni(789),1);

output;

end;

run;

Super User
Posts: 11,810

## Re: Finding the perimeter points of an area of points.

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

(0, 10)

(0,15)

(0,20)

( 5, 10)

( 5, 15)

(5,20)

(10,10)

(15,10)

(25,10)

which are "edge"?

Super Contributor
Posts: 259

## Re: Finding the perimeter points of an area of points.

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.

SAS Super FREQ
Posts: 3,839

## Re: Finding the perimeter points of an area of points.

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:

SAS/IML(R) 14.1 User's Guide

Discussion stats
• 3 replies
• 271 views
• 0 likes
• 3 in conversation