sc::vec2(3)
π sc::vec2 π
okay bestie, so this is sc::vec2 β that's the library function page for it, from the MPQC crew. It's a two-dimensional vector class and honestly? she's iconic. Let's get into it. π¦
β¨ NAME β¨
sc::vec2 β yes that's it, that's the whole name section, she needs no introduction π
πΈ SYNOPSIS πΈ
π Public Member Functions π
vec2 (const double x, const double y)
vec2 (const double d)
vec2 (const vec2 &v)
vec2 (const vec3 &v)
vec2 (const vec3 &v, int dropAxis)
vec2 & operator= (const vec2 &v)
vec2 & operator+= (const vec2 &v)
vec2 & operator-= (const vec2 &v)
vec2 & operator*= (const double d)
vec2 & operator/= (const double d)
double & operator[] (int i)
const double & operator[] (int i) const
double length ()
double length2 ()
vec2 & normalize ()
vec2 & apply (V_FCT_PTR fct)
the way she can be built from x and y, from a single d, from another vec2, from a vec3, or from a vec3 with an int dropAxis to yeet an axis out?? versatile queen β¨ and she's got the whole operator squad β =, +=, -=, *=, /=, and both the double & operator[] (int i) and its const double & operator[] (int i) const twin. Then length(), length2(), normalize(), and apply (V_FCT_PTR fct). no cap. π
π§ Protected Attributes π§
double n [2]
she's got double n [2] tucked away protected β inner workings, iykyk π
π Friends π
class vec3
vec2 operator- (const vec2 &v)
vec2 operator+ (const vec2 &a, const vec2 &b)
vec2 operator- (const vec2 &a, const vec2 &b)
vec2 operator* (const vec2 &a, const double d)
vec2 operator* (const double d, const vec2 &a)
vec2 operator* (const mat3 &a, const vec2 &v)
vec2 operator* (const vec2 &v, mat3 &a)
double operator* (const vec2 &a, const vec2 &b)
vec2 operator/ (const vec2 &a, const double d)
vec3 operator^ (const vec2 &a, const vec2 &b)
int operator== (const vec2 &a, const vec2 &b)
int operator!= (const vec2 &a, const vec2 &b)
std::ostream & operator<< (std::ostream &s, vec2 &v)
std::istream & operator>> (std::istream &s, vec2 &v)
void swap (vec2 &a, vec2 &b)
vec2 min (const vec2 &a, const vec2 &b)
vec2 max (const vec2 &a, const vec2 &b)
vec2 prod (const vec2 &a, const vec2 &b)
bestie look at this friend group π class vec3 is in there. Then unary operator- (const vec2 &v), the + and - between two vec2s, and the whole multiplication situation: vec2 * double, double * vec2, mat3 * vec2, vec2 * mat3, plus double operator* (const vec2 &a, const vec2 &b). Division vec2 / double, the caret vec3 operator^ (const vec2 &a, const vec2 &b), the comparisons int operator== and int operator!=, and the stream besties std::ostream & operator<< and std::istream & operator>>. Finishing strong with void swap, vec2 min, vec2 max, and vec2 prod. ate and left no crumbs π₯
π AUTHOR π
Generated automatically by Doxygen for MPQC from the source code. π€β¨
fr fr that's the whole page, no skips, no summaries, every single one of those signatures stayed exactly where she left them π«Ά
and that's a wrap, bestie β this was sc::vec2(3) from MPQC Version 2.3.1, mwah, go build something cute with it πππΈ
π¦ 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