SbVec2d(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– 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]
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. πŸ‘»

returns an SbVec2d instance which is the components of vector v multiplied with d.

returns an SbVec2d instance which is the components of vector v multiplied with d. yes, same thing, just the d came first. commutative slay. ✨

returns an SbVec2d instance which is the components of vector v divided on the scalar factor d.

returns an SbVec2d instance which is the sum of vectors v1 and v2.

returns an SbVec2d instance which is vector v2 subtracted from vector v1. order matters, don't play. πŸ’…

returns 1 if v1 and v2 are equal, 0 otherwise.

See also: equals().

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