RoundedPolygon.circle constructor
RoundedPolygon.circle({})
Implementation
factory RoundedPolygon.circle({
int numVertices = 8,
double radius = 1,
double centerX = 0,
double centerY = 0,
}) {
if (numVertices < 3) {
throw ArgumentError('Circle must have at least three vertices.');
}
final theta = math.pi / numVertices;
final polygonRadius = radius / math.cos(theta);
return RoundedPolygon.fromVerticesNum(
numVertices,
radius: polygonRadius,
centerX: centerX,
centerY: centerY,
rounding: CornerRounding(radius: radius),
);
}