.TH "SbVec2d" 3 "Tue Jun 23 2026 23:48:38" "Version 4.0.10" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbVec2d \- The \fBSbVec2d\fP class is a 2 dimensional vector with double precision floating point coordinates\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSbVec2d\fP (void)" .br .ti -1c .RI "\fBSbVec2d\fP (const double v[2])" .br .ti -1c .RI "\fBSbVec2d\fP (double x, double y)" .br .ti -1c .RI "\fBSbVec2d\fP (const \fBSbVec2f\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP (const \fBSbVec2b\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP (const \fBSbVec2s\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP (const \fBSbVec2i32\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBsetValue\fP (const double v[2])" .br .ti -1c .RI "\fBSbVec2d\fP & \fBsetValue\fP (double x, double y)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBsetValue\fP (const \fBSbVec2f\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBsetValue\fP (const \fBSbVec2b\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBsetValue\fP (const \fBSbVec2s\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBsetValue\fP (const \fBSbVec2i32\fP &v)" .br .ti -1c .RI "const double * \fBgetValue\fP (void) const" .br .ti -1c .RI "void \fBgetValue\fP (double &x, double &y) const" .br .ti -1c .RI "double & \fBoperator[]\fP (int i)" .br .ti -1c .RI "const double & \fBoperator[]\fP (int i) const" .br .ti -1c .RI "SbBool \fBequals\fP (const \fBSbVec2d\fP &v, double tolerance) const" .br .ti -1c .RI "double \fBdot\fP (const \fBSbVec2d\fP &v) const" .br .ti -1c .RI "double \fBlength\fP (void) const" .br .ti -1c .RI "double \fBsqrLength\fP (void) const" .br .ti -1c .RI "double \fBnormalize\fP (void)" .br .ti -1c .RI "void \fBnegate\fP (void)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBoperator*=\fP (double d)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBoperator/=\fP (double d)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBoperator+=\fP (const \fBSbVec2d\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP & \fBoperator\-=\fP (const \fBSbVec2d\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP \fBoperator\-\fP (void) const" .br .ti -1c .RI "void \fBprint\fP (FILE *fp) const" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "double \fBvec\fP [2]" .br .in -1c .SS "Related Symbols" (Note that these are not member symbols\&.) .in +1c .ti -1c .RI "\fBSbVec2d\fP \fBoperator*\fP (const \fBSbVec2d\fP &v, double d)" .br .ti -1c .RI "\fBSbVec2d\fP \fBoperator*\fP (double d, const \fBSbVec2d\fP &v)" .br .ti -1c .RI "\fBSbVec2d\fP \fBoperator/\fP (const \fBSbVec2d\fP &v, double d)" .br .ti -1c .RI "\fBSbVec2d\fP \fBoperator+\fP (const \fBSbVec2d\fP &v1, const \fBSbVec2d\fP &v2)" .br .ti -1c .RI "\fBSbVec2d\fP \fBoperator\-\fP (const \fBSbVec2d\fP &v1, const \fBSbVec2d\fP &v2)" .br .ti -1c .RI "int \fBoperator==\fP (const \fBSbVec2d\fP &v1, const \fBSbVec2d\fP &v2)" .br .ti -1c .RI "int \fBoperator!=\fP (const \fBSbVec2d\fP &v1, const \fBSbVec2d\fP &v2)" .br .in -1c .SH "Detailed Description" .PP The \fBSbVec2d\fP class is a 2 dimensional vector with double precision floating point coordinates\&. This vector class is used by many other classes in Coin\&. It provides storage for a vector in 2 dimensions as well as simple floating point arithmetic operations on this vector\&. .PP \fBSee also\fP .RS 4 \fBSbVec2s\fP, \fBSbVec2f\fP, \fBSbVec3s\fP, \fBSbVec3f\fP, \fBSbVec3d\fP, \fBSbVec4f\fP, \fBSbVec4d\fP\&. .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SbVec2d::SbVec2d (void )\fR [inline]\fP" The default constructor does nothing\&. The vector coordinates will be uninitialized until you do a \fBsetValue()\fP\&. .SS "SbVec2d::SbVec2d (const double v[2])\fR [inline]\fP" Constructs an \fBSbVec2d\fP instance with initial values from \fIv\fP\&. .SS "SbVec2d::SbVec2d (double x, double y)\fR [inline]\fP" Constructs an \fBSbVec2d\fP instance with the initial vector endpoints from \fIx\fP and \fIy\fP\&. .SS "SbVec2d::SbVec2d (const \fBSbVec2f\fP & v)\fR [inline]\fP, \fR [explicit]\fP" Constructs an \fBSbVec2d\fP instance from an \fBSbVec2f\fP instance\&. .PP \fBSince\fP .RS 4 Coin 2\&.5 .RE .PP .SS "SbVec2d::SbVec2d (const \fBSbVec2b\fP & v)\fR [inline]\fP, \fR [explicit]\fP" Constructs an \fBSbVec2d\fP instance from an \fBSbVec2b\fP instance\&. .PP \fBSince\fP .RS 4 Coin 2\&.5 .RE .PP .SS "SbVec2d::SbVec2d (const \fBSbVec2s\fP & v)\fR [inline]\fP, \fR [explicit]\fP" Constructs an \fBSbVec2d\fP instance from an \fBSbVec2s\fP instance\&. .PP \fBSince\fP .RS 4 Coin 2\&.5 .RE .PP .SS "SbVec2d::SbVec2d (const \fBSbVec2i32\fP & v)\fR [inline]\fP, \fR [explicit]\fP" Constructs an \fBSbVec2d\fP instance from an \fBSbVec2i32\fP instance\&. .PP \fBSince\fP .RS 4 Coin 2\&.5 .RE .PP .SH "Member Function Documentation" .PP .SS "\fBSbVec2d\fP & SbVec2d::setValue (const double v[2])\fR [inline]\fP" Set new x and y coordinates for the vector from \fIv\fP\&. Returns reference to self\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP\&. .RE .PP .SS "\fBSbVec2d\fP & SbVec2d::setValue (double x, double y)\fR [inline]\fP" Set new x and y coordinates for the vector\&. Returns reference to self\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP\&. .RE .PP .SS "\fBSbVec2d\fP & SbVec2d::setValue (const \fBSbVec2f\fP & v)" Sets the value from an \fBSbVec2f\fP instance\&. Returns reference to itself\&. .PP \fBSince\fP .RS 4 Coin 2\&.5 .RE .PP .SS "\fBSbVec2d\fP & SbVec2d::setValue (const \fBSbVec2b\fP & v)" Sets the value from an \fBSbVec2b\fP instance\&. Returns reference to itself\&. .PP \fBSince\fP .RS 4 Coin 2\&.5 .RE .PP .SS "\fBSbVec2d\fP & SbVec2d::setValue (const \fBSbVec2s\fP & v)" Sets the value from an \fBSbVec2s\fP instance\&. Returns reference to itself\&. .PP \fBSince\fP .RS 4 Coin 2\&.5 .RE .PP .SS "\fBSbVec2d\fP & SbVec2d::setValue (const \fBSbVec2i32\fP & v)" Sets the value from an \fBSbVec2i32\fP instance\&. Returns reference to itself\&. .PP \fBSince\fP .RS 4 Coin 2\&.5 .RE .PP .SS "const double * SbVec2d::getValue (void ) const\fR [inline]\fP" Returns a pointer to an array of two double containing the x and y coordinates of the vector\&. .PP \fBSee also\fP .RS 4 \fBsetValue()\fP\&. .RE .PP .SS "void SbVec2d::getValue (double & x, double & y) const\fR [inline]\fP" Returns the x and y coordinates of the vector\&. .PP \fBSee also\fP .RS 4 \fBsetValue()\fP\&. .RE .PP .SS "double & SbVec2d::operator[] (int i)\fR [inline]\fP" Index operator\&. Returns modifiable x or y coordinate\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP and \fBsetValue()\fP\&. .RE .PP .SS "const double & SbVec2d::operator[] (int i) const\fR [inline]\fP" Index operator\&. Returns x or y coordinate\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP\&. .RE .PP .SS "SbBool SbVec2d::equals (const \fBSbVec2d\fP & v, double tolerance) const" Compares the vector with \fIv\fP and returns \fRTRUE\fP if the distance between the vectors is smaller or equal to the square root of \fItolerance\fP\&. .SS "double SbVec2d::dot (const \fBSbVec2d\fP & v) const\fR [inline]\fP" Calculates and returns the result of taking the dot product of this vector and \fIv\fP\&. .SS "double SbVec2d::length (void ) const" Return length of vector\&. .SS "double SbVec2d::sqrLength (void ) const\fR [inline]\fP" Returns the square of the length of the vector\&. .SS "double SbVec2d::normalize (void )" Normalize the vector to unit length\&. Return value is the original length of the vector before normalization\&. .SS "void SbVec2d::negate (void )\fR [inline]\fP" Negate the vector (i\&.e\&. point it in the opposite direction)\&. .SS "\fBSbVec2d\fP & SbVec2d::operator*= (double d)\fR [inline]\fP" Multiply components of vector with value \fId\fP\&. Returns reference to self\&. .SS "\fBSbVec2d\fP & SbVec2d::operator/= (double d)\fR [inline]\fP" Divides components of vector with value \fId\fP\&. Returns reference to self\&. .SS "\fBSbVec2d\fP & SbVec2d::operator+= (const \fBSbVec2d\fP & v)\fR [inline]\fP" Adds this vector and vector \fIu\fP\&. Returns reference to self\&. .SS "\fBSbVec2d\fP & SbVec2d::operator\-= (const \fBSbVec2d\fP & v)\fR [inline]\fP" Subtracts vector \fIu\fP from this vector\&. Returns reference to self\&. .SS "\fBSbVec2d\fP SbVec2d::operator\- (void ) const\fR [inline]\fP" Non-destructive negation operator\&. Returns a new \fBSbVec2d\fP instance which points in the opposite direction of this vector\&. .PP \fBSee also\fP .RS 4 \fBnegate()\fP\&. .RE .PP .SS "void SbVec2d::print (FILE * fp) const" Dump the state of this object to the \fIfp\fP file stream\&. Only works in debug version of library, method does nothing in an optimized build\&. .SH "Friends And Related Symbol Documentation" .PP .SS "\fBSbVec2d\fP operator* (const \fBSbVec2d\fP & v, double d)\fR [related]\fP" Returns an \fBSbVec2d\fP instance which is the components of vector \fIv\fP multiplied with \fId\fP\&. .SS "\fBSbVec2d\fP operator* (double d, const \fBSbVec2d\fP & v)\fR [related]\fP" Returns an \fBSbVec2d\fP instance which is the components of vector \fIv\fP multiplied with \fId\fP\&. .SS "\fBSbVec2d\fP operator/ (const \fBSbVec2d\fP & v, double d)\fR [related]\fP" Returns an \fBSbVec2d\fP instance which is the components of vector \fIv\fP divided on the scalar factor \fId\fP\&. .SS "\fBSbVec2d\fP operator+ (const \fBSbVec2d\fP & v1, const \fBSbVec2d\fP & v2)\fR [related]\fP" Returns an \fBSbVec2d\fP instance which is the sum of vectors \fIv1\fP and \fIv2\fP\&. .SS "\fBSbVec2d\fP operator\- (const \fBSbVec2d\fP & v1, const \fBSbVec2d\fP & v2)\fR [related]\fP" Returns an \fBSbVec2d\fP instance which is vector \fIv2\fP subtracted from vector \fIv1\fP\&. .SS "int operator== (const \fBSbVec2d\fP & v1, const \fBSbVec2d\fP & v2)\fR [related]\fP" Returns \fI1\fP if \fIv1\fP and \fIv2\fP are equal, \fI0\fP otherwise\&. .PP \fBSee also\fP .RS 4 \fBequals()\fP\&. .RE .PP .SS "int operator!= (const \fBSbVec2d\fP & v1, const \fBSbVec2d\fP & v2)\fR [related]\fP" Returns \fI1\fP if \fIv1\fP and \fIv2\fP are not equal, \fI0\fP if they are equal\&. .PP \fBSee also\fP .RS 4 \fBequals()\fP\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.