sc::vec2(3)

πŸ“¦
version 2.3.1 Β· 4 versions
, in fedora 43, ubuntu noble

πŸ‘‘ 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