sphere
Creates a new sphere.
Syntax
-
sphere([a[, r]])
-
a
is a three-dimensional vector -
r
is a positive real number
-
Description
sphere(a, r)
creates a sphere of radius r
centred at a
.
If omitted, a
defaults to ❨0, 0, 0❩
and r
to 1
.
Consequently, sphere(a, r)
is equivalent to ellipsoid(a, ❨r, r, r❩)
.
The object is shown in the current scene and a reference to the object is returned.
The AdjustVisual
function can be used to adjust the appearance of the sphere. See Visual settings for a list of applicable settings.
Examples
sphere()
scene("balls"); for(k, 1, 10, sphere(10⋅RandomVector(3), RandomReal())); scene("balls")
scene("balls"); for(k, −10, 10, if(k ≠ 0, sphere(❨0, 0, k❩, abs(k)/2.5))); scene("balls")