Optionalsquare: booleanStaticRELATIVE_The values returned by relativePosition.
Output option: the form (x-a)^2+(y-b)^2+(z-c)^2=r^2 (default). Chainable, persistent.
Output option: the developed equation. Chainable, persistent.
ASCIIMath rendering of the current state (terminal output, not chainable).
The square of the radius, as an exact fraction.
LaTeX rendering of the current state (terminal output, not chainable).
Full duplicate of this instance, including display state (selected form
and options set via as*** / with***). Distinct from copy.
Copy the mathematical state of another instance into this (display
state is NOT transferred — the receiver keeps its own formatting). Entry
point used when constructing/parsing from a same-type input. Distinct from
clone. Classes without a real implementation throw
NotImplementedError.
True when both spheres have the same center and the same radius.
Replace the sphere with an equation, another sphere, or a center and a radius. Arguments that do not match any form leave the sphere unchanged.
The relative position of two spheres, as a Sphere3.RELATIVE_POSITION value: interior, exterior, secant, tangent inside or outside, superposed, or concentric.
StaticfromThe sphere with the given center and radius.
Optionalsquare: boolean
when true, radius is already the square of the radius.
StaticfromStaticfrom
A sphere of space, stored by its center and the square of its radius, so that everything stays exact. Built from an equation (
"(x-1)^2+y^2+z^2=9") or from a center and a radius. A sphere that has not been defined throws aStateErrorwhen it is read.Example