findExtremePoints function

Find extreme points