sc::CS2Sphere(3)
π NAME π
sc::CS2Sphere β bestie, this is the little sphere class that knows how to vibe-check other spheres. It's a 3D ball with a center and a radius, and it's obsessed with figuring out whether other spheres are touching it, overlapping it, or just orbiting nearby. Geometry queen energy πβ¨
π¦ SYNOPSIS π¦
Okay so here's the whole squad of member functions, no skips, no cuts, we're listing all of them because every single one ate π
πΈ Public Member Functions πΈ
CS2Sphere (const SCVector3 &v, double rad)
CS2Sphere (double x, double y, double z, double rad)
void initialize (SCVector3 &v, double rad)
CS2Sphere & operator= (const CS2Sphere &s)
double distance (CS2Sphere &asphere)
double common_radius (CS2Sphere &asphere)
const SCVector3 & center (void) const
double x () const
double y () const
double z () const
SCVector3 center_vec (const SC2Sphere &asphere)
double radius (void) const
void recenter (const SCVector3 &v)
void print (std::ostream &os=ExEnv::out0()) const
int intersect (CS2Sphere *s, int n_spheres) const
π Static Public Member Functions π
static void print_counts (std::ostream &=ExEnv::out0())
π§ Static Public Attributes π§
static int n_no_spheres_
static int n_probe_enclosed_by_a_sphere_
static int n_probe_center_not_enclosed_
static int n_surface_of_s0_not_covered_
static int n_plane_totally_covered_
static int n_internal_edge_not_covered_
static int n_totally_covered_
π DESCRIPTION π
Not me about to explain a sphere like it's not the most iconic shape in all of geometry π A sc::CS2Sphere is literally just a center plus a radius. You can build one from an SCVector3 and a radius, or from raw x, y, z coordinates and a radius β whichever feels more main character to you.
Then the fun part: it can measure how far away another sphere is, find a radius it shares with another sphere, hand you back its center (as a vector or as individual x, y, z values), and recenter itself onto a new vector if you need it to move. It can also print itself out, and it can intersect against an array of spheres to figure out what's going on β which is exactly the tea those static counters below are keeping track of. π«
β¨ OPTIONS β¨
(okay technically these are constructors and member functions but we're treating them like the menu of choices they are, bestie)
CS2Sphere (const SCVector3 &v, double rad)β spin up a sphere from a center vectorvand a radiusrad. Instant glow-up πCS2Sphere (double x, double y, double z, double rad)β same energy, but you feed it the center as three loose doublesx,y,zplus the radiusrad.void initialize (SCVector3 &v, double rad)β set up the sphere in place from center vectorvand radiusrad.CS2Sphere & operator= (const CS2Sphere &s)β copy another spheres's whole vibe onto this one. Returns a reference to this sphere, so you can chain it like the icon you are πdouble distance (CS2Sphere &asphere)β how far apart are me andasphere? Returns the number, no drama.double common_radius (CS2Sphere &asphere)β finds the radius that this sphere andaspherehave in common.const SCVector3 & center (void) constβ hands you back a const reference to the center vector. Look, don't touch πdouble x () constβ just the center's x-coordinate, bestie.double y () constβ just the center's y-coordinate. You knew that. πdouble z () constβ and the z-coordinate, completing the trio β¨SCVector3 center_vec (const SC2Sphere &asphere)β gives you a center vector computed with respect toasphere.double radius (void) constβ your radius. That's it. That's the function.void recenter (const SCVector3 &v)β pack up and move the center tov. New location, same radius, same girl π¦void print (std::ostream &os=ExEnv::out0()) constβ writes the sphere out to the streamos, which defaults toExEnv::out0()if you don't wanna bother picking one.int intersect (CS2Sphere *s, int n_spheres) constβ the big one π₯ Checks this sphere against an arraysofn_spheresspheres and returns anint. It tallies everything into the static counters listed below, so keep reading.static void print_counts (std::ostream &=ExEnv::out0())β static function that prints out all those accumulated counters to the stream, which defaults toExEnv::out0(). Perfect for when you need receipts π
π Static Public Attributes π
These are the static counters, and every single one is a running tally of something intersect noticed. Not me keeping score π
static int n_no_spheres_β count of the no-spheres case.static int n_probe_enclosed_by_a_sphere_β count of times the probe was enclosed by a sphere.static int n_probe_center_not_enclosed_β count of times the probe's center was not enclosed.static int n_surface_of_s0_not_covered_β count of times the surface ofs0was not covered.static int n_plane_totally_covered_β count of times the plane was totally covered. Slay, honestly.static int n_internal_edge_not_covered_β count of times an internal edge was not covered.static int n_totally_covered_β count of times everything was totally covered. The dream scenario π
π AUTHOR π
Generated automatically by Doxygen for MPQC from the source code. The robot wrote it, we just made it cute π
fr fr, that's the whole page. Every function, every counter, every default β nothing got left on read π
MPQC β Version 2.3.1 β sc::CS2Sphere(3) πΈ mwah, go forth and intersect responsibly π«Ά
π¦ where this page comes from
- fedora 43: mpqc-devel 2.3.1-65.fc43 Β· GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+
- fedora 43: mpqc-devel 2.3.1-65.fc43 Β· GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+
- ubuntu noble: libsc-doc 2.3.1-22build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms