SbVec2d(3)
π SbVec2d π
okay bestie, welcome to the Coin manual, section 3. This one's about SbVec2d, and honestly? She's an icon. Let's get into it. π¦
β¨ NAME β¨
SbVec2d β the class that's a 2 dimensional vector with double precision floating point coordinates. that's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
first things first, you gotta let her in:
#include <Inventor/SbVec2d.h>
πΈ Public Member Functions πΈ
no cap, here's every single one, in order, exactly as she comes:
SbVec2d (void)
SbVec2d (const double v[2])
SbVec2d (double x, double y)
SbVec2d (const SbVec2f &v)
SbVec2d (const SbVec2b &v)
SbVec2d (const SbVec2s &v)
SbVec2d (const SbVec2i32 &v)
SbVec2d & setValue (const double v[2])
SbVec2d & setValue (double x, double y)
SbVec2d & setValue (const SbVec2f &v)
SbVec2d & setValue (const SbVec2b &v)
SbVec2d & setValue (const SbVec2s &v)
SbVec2d & setValue (const SbVec2i32 &v)
const double * getValue (void) const
void getValue (double &x, double &y) const
double & operator[] (int i)
const double & operator[] (int i) const
SbBool equals (const SbVec2d &v, double tolerance) const
double dot (const SbVec2d &v) const
double length (void) const
double sqrLength (void) const
double normalize (void)
void negate (void)
SbVec2d & operator*= (double d)
SbVec2d & operator/= (double d)
SbVec2d & operator+= (const SbVec2d &v)
SbVec2d & operator-= (const SbVec2d &v)
SbVec2d operator- (void) const
void print (FILE *fp) const
π Protected Attributes π
double vec [2]
π¦ Related Symbols π¦
heads up bestie: these are not member symbols, they just live in the same friend group.
SbVec2d operator* (const SbVec2d &v, double d)
SbVec2d operator* (double d, const SbVec2d &v)
SbVec2d operator/ (const SbVec2d &v, double d)
SbVec2d operator+ (const SbVec2d &v1, const SbVec2d &v2)
SbVec2d operator- (const SbVec2d &v1, const SbVec2d &v2)
int operator== (const SbVec2d &v1, const SbVec2d &v2)
int operator!= (const SbVec2d &v1, const SbVec2d &v2)
β¨ Detailed Description β¨
so, SbVec2d is a 2 dimensional vector with double precision floating point coordinates. that's the headline. π
this vector class is used by many other classes in Coin. she provides storage for a vector in 2 dimensions, plus simple floating point arithmetic operations on that vector. she's basically the main character of math storage. periodt. π
See also
SbVec2s, SbVec2f, SbVec3s, SbVec3f, SbVec3d, SbVec4f, SbVec4d.
π Constructor & Destructor Documentation π
π§ SbVec2d::SbVec2d (void ) [inline]
the default constructor does nothing. like, literally nothing. the vector coordinates will be uninitialized until you do a setValue(). so pls don't go reading them and act surprised, bestie. π
π§ SbVec2d::SbVec2d (const double v[2]) [inline]
makes an SbVec2d instance with initial values from v. π«Ά
π§ SbVec2d::SbVec2d (double x, double y) [inline]
makes an SbVec2d instance with the initial vector endpoints from x and y. adorable. πΈ
π§ SbVec2d::SbVec2d (const SbVec2f & v) [inline], [explicit]
makes an SbVec2d instance from an SbVec2f instance.
Since: Coin 2.5
π§ SbVec2d::SbVec2d (const SbVec2b & v) [inline], [explicit]
makes an SbVec2d instance from an SbVec2b instance.
Since: Coin 2.5
π§ SbVec2d::SbVec2d (const SbVec2s & v) [inline], [explicit]
makes an SbVec2d instance from an SbVec2s instance.
Since: Coin 2.5
π§ SbVec2d::SbVec2d (const SbVec2i32 & v) [inline], [explicit]
makes an SbVec2d instance from an SbVec2i32 instance.
Since: Coin 2.5
β Member Function Documentation β
π SbVec2d & SbVec2d::setValue (const double v[2]) [inline]
sets brand new x and y coordinates for the vector, pulling them from v. returns a reference to self, because she's generous like that. π
See also: getValue().
π SbVec2d & SbVec2d::setValue (double x, double y) [inline]
sets brand new x and y coordinates for the vector. returns reference to self.
See also: getValue().
π SbVec2d & SbVec2d::setValue (const SbVec2f & v)
sets the value from an SbVec2f instance. returns reference to itself.
Since: Coin 2.5
π SbVec2d & SbVec2d::setValue (const SbVec2b & v)
sets the value from an SbVec2b instance. returns reference to itself.
Since: Coin 2.5
π SbVec2d & SbVec2d::setValue (const SbVec2s & v)
sets the value from an SbVec2s instance. returns reference to itself.
Since: Coin 2.5
π SbVec2d & SbVec2d::setValue (const SbVec2i32 & v)
sets the value from an SbVec2i32 instance. returns reference to itself.
Since: Coin 2.5
π const double * SbVec2d::getValue (void ) const [inline]
hands you back a pointer to an array of two double containing the x and y coordinates of the vector. two. that's the whole array. no notes.
See also: setValue().
π void SbVec2d::getValue (double & x, double & y) const [inline]
gives you the x and y coordinates of the vector. straight to your variables, no pointer middleman.
See also: setValue().
π double & SbVec2d::operator[] (int i) [inline]
the index operator. returns a modifiable x or y coordinate, so go off, change it. β¨
See also: getValue() and setValue().
π const double & SbVec2d::operator[] (int i) const [inline]
the index operator, but the chill version. returns the x or y coordinate. read-only energy.
See also: getValue().
π SbBool SbVec2d::equals (const SbVec2d & v, double tolerance) const
compares the vector with v and returns TRUE if the distance between the vectors is smaller or equal to the square root of tolerance. yes, the square root. read it again. that's not a typo, that's just how she is. π
π double SbVec2d::dot (const SbVec2d & v) const [inline]
calculates and returns the result of taking the dot product of this vector and v. math girlies rise. π₯
π double SbVec2d::length (void ) const
returns the length of the vector. simple. iconic.
π double SbVec2d::sqrLength (void ) const [inline]
returns the square of the length of the vector. note the sqr, bestie.
π double SbVec2d::normalize (void )
normalizes the vector to unit length. the return value is the original length of the vector before normalization, so you don't lose the receipts. π§Ύ
π void SbVec2d::negate (void ) [inline]
negates the vector β i.e. points it in the opposite direction. she's turning around. dramatic? maybe. correct? yes.
π SbVec2d & SbVec2d::operator*= (double d) [inline]
multiplies the components of the vector with the value d. returns reference to self.
π SbVec2d & SbVec2d::operator/= (double d) [inline]
divides the components of the vector with the value d. returns reference to self.
π SbVec2d & SbVec2d::operator+= (const SbVec2d & v) [inline]
adds this vector and vector u. returns reference to self.
π SbVec2d & SbVec2d::operator-= (const SbVec2d & v) [inline]
subtracts vector u from this vector. returns reference to self.
π SbVec2d SbVec2d::operator- (void ) const [inline]
the non-destructive negation operator. returns a new SbVec2d instance pointing in the opposite direction of this vector β your original stays untouched, she would never. π«Ά
See also: negate().
π void SbVec2d::print (FILE * fp) const
dumps the state of this object to the fp file stream.
β οΈ bestie, listen: this only works in the debug version of the library. in an optimized build, the method does nothing. nothing at all. it's giving ghost. π»
π Friends And Related Symbol Documentation π
π SbVec2d operator* (const SbVec2d & v, double d) [related]
returns an SbVec2d instance which is the components of vector v multiplied with d.
π SbVec2d operator* (double d, const SbVec2d & v) [related]
returns an SbVec2d instance which is the components of vector v multiplied with d. yes, same thing, just the d came first. commutative slay. β¨
π SbVec2d operator/ (const SbVec2d & v, double d) [related]
returns an SbVec2d instance which is the components of vector v divided on the scalar factor d.
π SbVec2d operator+ (const SbVec2d & v1, const SbVec2d & v2) [related]
returns an SbVec2d instance which is the sum of vectors v1 and v2.
π SbVec2d operator- (const SbVec2d & v1, const SbVec2d & v2) [related]
returns an SbVec2d instance which is vector v2 subtracted from vector v1. order matters, don't play. π
π int operator== (const SbVec2d & v1, const SbVec2d & v2) [related]
returns 1 if v1 and v2 are equal, 0 otherwise.
See also: equals().
π int operator!= (const SbVec2d & v1, const SbVec2d & v2) [related]
returns 1 if v1 and v2 are not equal, 0 if they are equal.
See also: equals().
β¨ Author β¨
generated automatically by Doxygen for Coin, straight from the source code. the robots did this one, we just gave it a makeover. π€π
okay and that's the whole page, bestie!! π this was Version 4.0.10 of the Coin manual, dated Thu Jun 25 2026 00:00:00, and it's filed under section 3 as SbVec2d(3). go forth and vector responsibly. mwah. π
π¦β¨
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms