The Sphere implements a sphere represented by a center point and a radius.
The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the sphere
with updates values.
It also implies that the values of the sphere cannot be directly modified.
The concept of immutability improves sharing of objects as all types in TypeScript are assigned
by identity, instead of by-value (e.g. a copy) as in other programming languages like C.
The Sphere implements a sphere represented by a center point and a radius. The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the sphere with updates values. It also implies that the values of the sphere cannot be directly modified.
The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.