getTopPoint method Null safety
Get the furthest top point of the polygon
Implementation
static Point getTopPoint(List<Point> polygon) {
assert(polygon.length >= 3);
var topPoint = Point<num>(double.negativeInfinity, double.negativeInfinity);
for (var p in polygon) {
if (p.y > topPoint.y) {
topPoint = p;
}
}
return topPoint;
}