'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SbVec2f(3IV) .SH NAME SbVec2f \(em 2D vector class .SH INHERITS FROM SbVec2f .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 1i \f1Methods from class SbVec2f: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbVec2f\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbVec2f\*(Cr(const float v[2]) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbVec2f\*(Cr(float x, float y) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbdot\*(Cr(const SbVec2f &v) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbequals\*(Cr(const SbVec2f v, float tolerance) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst float * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetValue\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetValue\*(Cr(float &x, float &y) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cblength\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbnegate\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbnormalize\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetValue\*(Cr(const float v[2]) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetValue\*(Cr(float x, float y) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator [\|]\*(Cr(int i) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst float & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator [\|]\*(Cr(int i) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *=\*(Cr(float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator /=\*(Cr(float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator +=\*(Cr(const SbVec2f &u) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -=\*(Cr(const SbVec2f &u) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *\*(Cr(const SbVec2f &v, float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *\*(Cr(float d, const SbVec2f &v) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator /\*(Cr(const SbVec2f &v, float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator +\*(Cr(const SbVec2f &v1, const SbVec2f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -\*(Cr(const SbVec2f &v1, const SbVec2f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator ==\*(Cr(const SbVec2f &v1, const SbVec2f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator !=\*(Cr(const SbVec2f &v1, const SbVec2f &v2) .sp .SH DESCRIPTION 2D vector class used to store 2D vectors and points. This class is used throughout Inventor for arguments and return values. .SH METHODS .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbVec2f\*(Cr() .br .in 1i \f1Default constructor. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbVec2f\*(Cr(const float v[2]) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbVec2f\*(Cr(float x, float y) .br .in 1i \f1Constructor given vector components. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbdot\*(Cr(const SbVec2f &v) const .br .in 1i \f1Returns dot (inner) product of vector and another vector. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbequals\*(Cr(const SbVec2f v, float tolerance) const .br .in 1i \f1Equality comparison within given tolerance \(em the square of the length of the maximum distance between the two vectors. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst float * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetValue\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetValue\*(Cr(float &x, float &y) const .br .in 1i \f1Returns vector components. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cblength\*(Cr() const .br .in 1i \f1Returns geometric length of vector. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbnegate\*(Cr() .br .in 1i \f1Negates each component of vector in place. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbnormalize\*(Cr() .br .in 1i \f1Changes vector to be unit length. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetValue\*(Cr(const float v[2]) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetValue\*(Cr(float x, float y) .br .in 1i \f1Sets the vector components. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator [\|]\*(Cr(int i) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst float & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator [\|]\*(Cr(int i) .br .in 1i \f1Accesses indexed component of vector. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *=\*(Cr(float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator /=\*(Cr(float d) .br .in 1i \f1Component-wise scalar multiplication and division operators. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator +=\*(Cr(const SbVec2f &u) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -=\*(Cr(const SbVec2f &u) .br .in 1i \f1Component-wise vector addition and subtraction operators. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -\*(Cr() const .br .in 1i \f1Nondestructive unary negation \(em returns a new vector. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *\*(Cr(const SbVec2f &v, float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *\*(Cr(float d, const SbVec2f &v) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator /\*(Cr(const SbVec2f &v, float d) .br .in 1i \f1Component-wise binary scalar multiplication and division operators. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator +\*(Cr(const SbVec2f &v1, const SbVec2f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec2f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -\*(Cr(const SbVec2f &v1, const SbVec2f &v2) .br .in 1i \f1Component-wise binary vector addition and subtraction operators. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator ==\*(Cr(const SbVec2f &v1, const SbVec2f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator !=\*(Cr(const SbVec2f &v1, const SbVec2f &v2) .br .in 1i \f1Equality comparison operators. .sp .in 0.5i .SH SEE ALSO \*(CbSbVec3f, SbVec4f, SbVec2s, SbRotation