Sector constructor

Sector(
  1. num radius,
  2. Angle centralAngle, {
  3. Point? center,
})

Creates a sector with the specified radius and central angle.

radius must be positive. centralAngle is the angle of the sector. center is the optional center point (defaults to origin).

Throws ArgumentError if radius is not positive.

Implementation

Sector(num radius, this.centralAngle, {Point? center})
    : _radius = radius,
      center = center ?? Point(0, 0),
      super('Sector') {
  if (radius <= 0) {
    throw ArgumentError('Radius must be positive, got: $radius');
  }
}