sc::vec4(3)
π¦ sc::vec4 π¦
okay so bestie, welcome to the Library Functions Manual page for sc::vec4 π this is a four-component vector and the way it's laid out? immaculate. Everything she can do, everyone she lets near her, all of it's right here. Let's go, no cap β¨
πΈ NAME πΈ
sc::vec4 β that's the whole name, she's short, she's sweet, she's iconic π
β¨ SYNOPSIS β¨
here's the whole menu, bestie β read it like a cafe board and order whatever your heart wants β
π Public Member Functions π
these are the public ones, so literally anybody can call them. open invite energy π
vec4 (const double x, const double y, const double z, const double w)
vec4 (const double d)
vec4 (const vec4 &v)
vec4 (const vec3 &v)
vec4 (const vec3 &v, const double d)
vec4 & operator= (const vec4 &v)
vec4 & operator+= (const vec4 &v)
vec4 & operator-= (const vec4 &v)
vec4 & operator*= (const double d)
vec4 & operator/= (const double d)
double & operator[] (int i)
const double & operator[] (int i) const
double length ()
double length2 ()
vec4 & normalize ()
vec4 & apply (V_FCT_PTR fct)
quick vibe check on what's in there:
- the constructors: one takes four
doubles βx,y,zandw; one takes a singledoubled; one is the copy constructor taking aconst vec4 &v; one takes aconst vec3 &v; and one takes aconst vec3 &vplus adoubled. five ways to be born, all valid π - the assignment and compound assignment crew:
operator=,operator+=,operator-=all take aconst vec4 &v, whileoperator*=andoperator/=take adoubledβ and every single one of them hands you back avec4 &π«Ά - the indexing:
operator[]takes anint iand gives you adouble &β and there's a second one that'sconst, handing back aconst double &, so your const objects get love too π length()andlength2()both return adouble, no arguments, no dramanormalize()returns avec4 &(she returns herself, queen behaviour π)apply()takes aV_FCT_PTR fctand also returns avec4 &
π Protected Attributes π
double n [4]
this one's protected, so it's not for just anyone β class-internal and friends only, VIP section, no plus-ones π
π Friends π
these are the besties who get to peek behind the curtain. full list, no skips:
class vec3
class mat4
vec4 operator- (const vec4 &v)
vec4 operator+ (const vec4 &a, const vec4 &b)
vec4 operator- (const vec4 &a, const vec4 &b)
vec4 operator* (const vec4 &a, const double d)
vec4 operator* (const double d, const vec4 &a)
vec4 operator* (const mat4 &a, const vec4 &v)
vec4 operator* (const vec4 &v, const mat4 &a)
double operator* (const vec4 &a, const vec4 &b)
vec4 operator/ (const vec4 &a, const double d)
int operator== (const vec4 &a, const vec4 &b)
int operator!= (const vec4 &a, const vec4 &b)
std::ostream & operator<< (std::ostream &s, vec4 &v)
std::istream & operator>> (std::istream &s, vec4 &v)
void swap (vec4 &a, vec4 &b)
vec4 min (const vec4 &a, const vec4 &b)
vec4 max (const vec4 &a, const vec4 &b)
vec4 prod (const vec4 &a, const vec4 &b)
vec3 operator* (const mat4 &a, const vec3 &v)
mat4 operator* (const mat4 &a, const mat4 &b)
look at all those operators fr fr β unary minus, plus, minus, multiply every which way (vector times double, double times vector, mat4 times vec4, vec4 times mat4, and vec4 times vec4 giving back a plain double), divide, == and != handing back an int, the << and >> stream friends, swap, min, max, prod, plus a couple of mat4/vec3 crossovers at the bottom. it's giving extended family ππ₯
π«Ά Author π«Ά
Generated automatically by Doxygen for MPQC from the source code. (yes bestie, a robot wrote her bio and honestly? still ate π )
and that's the whole page, no crumbs left πΈ mwah π this was MPQC Version 2.3.1, page sc::vec4(3) β go forth and multiply your vectors, periodt β¨π
π¦ 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