Sphere constructor

Sphere(
  1. num radius, {
  2. Point? center,
})

Creates a sphere with the specified radius and optional center.

radius must be positive. center defaults to (0, 0, 0).

Implementation

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