FBase | +----FVector2
#include <Flek/FVector2.H>
fVector2 is a 2 dimensional vector represented internally as an array of doubles. This class is related to fVector3 and fVector4 which are 3-D and 4-D versions of this class. All fVector classes are forward declared in fVector.h.
virtual FVector2::FBase(void);
Make a copy of the object.
FVector2::FVector2();
The default constructor sets each element in the vector to 0.FVector2::FVector2(double val);
This one argument constructor intializes all elements in the vector with the given value.FVector2::FVector2(double * arr);
This one argument constructor initializes the vector with the first three elements in the given array.FVector2::FVector2(double val1, double val2);
This two argument constructor initializes the vector with the passed values.FVector2::FVector2(const FVector2& vec);
The copy constructor initializes this vector with the contents of another vector.FVector2::FVector2(const FVector3& vec);
This constructor initializes the vector from the contents of a FVector3. The third element in the FVector3 is ignored.FVector2::FVector2(const FVector4& vec);
This constructor initializes the vector from the contents of a FVector4. The third element in the FVector4 is ignored.
void FVector2::copy_from(const FVector3& vec);
Initialize the elements from a FVector3,void FVector2::copy_from(const FVector4& vec);
Initialize the elements from a FVector4,
void FVector2::fill_array(double arr[2]);
Fill an array with the elements of the vector.
void FVector2::get(double& v1, double& v2);
Get the elements of vector into given values.
double FVector2::length();
Length (norm) of the vector.
friend double FVector2::norm(const FVector2& vec);
Norm of the vector.
friend double FVector2::normalize(FVector2& vec);
Normalize. Returns previous norm.
friend FVector2 FVector2::normalized(const FVector2& vec);
Returns normalized vector.
friend double FVector2::normsqr(const FVector2& vec);
Square of the norm of the vector.
bool FVector2::operator !=(const FVector2& vec);
Boolean ineqality operator.
double FVector2::operator * (const FVector2& vec);
Operator for scalar multiplication (dot product).friend FVector2 FVector2::operator * (double scalar, const FVector2& vec);
Friend operator for scalar pre-multiplication.friend FVector2 FVector2::operator * (const FVector2& vec, double scalar);
Friend operator for scalar post-multiplication.
void FVector2::operator *=(double scalar);
Arithmetic operator for multiplicative (scalar) assignment.
FVector2 FVector2::operator +(const FVector2& vec);
Arithmetic operator for addition.
void FVector2::operator +=(const FVector2& vec);
Arithmetic operator for additive assignment.
FVector2 FVector2::operator -(const FVector2& vec);
Arithmetic operator for subtraction.friend FVector2 FVector2::operator -(const FVector2& vec);
Friend operator for negation.
void FVector2::operator -=(const FVector2& vec);
Arithmetic operator for subtractive assignment.
friend FVector2 FVector2::operator /(const FVector2& vec, double scalar);
Friend operator for scalar division.
void FVector2::operator /=(double scalar);
Arithmetic operator for divisive (scalar) assignment.
friend ostream& FVector2::operator <<(ostream& o, const FVector2& vec);
I/O Stream insertion operator. Of the form "[ x y z ]".
FVector2& FVector2::operator =(const FVector2& vec);
Assignment operator from another FVector2.FVector2& FVector2::operator =(double scalar);
Assignment operator from a scalar. All elements are set to the scalar value.FVector2& FVector2::operator =(const FVector3& vec);
Assignment operator from a FVector3. Copies first 2 elements.FVector2& FVector2::operator =(const FVector4& vec);
Assignment operator from a FVector4. Copies first 2 elements.
bool FVector2::operator ==(const FVector2& vec);
Boolean equality operator.
friend istream& FVector2::operator >>(istream& i, FVector2& vec);
I/O Stream extraction operator. Of the form "[ x y ]".
double& FVector2::operator [] (uint index);
Element access operator. For efficiency, this doesn't check for valid indicesdouble FVector2::operator [] (uint index);
Element access operator. For efficiency, this doesn't check for valid indices
friend FVector2 FVector2::product(const FVector2& vec1, const FVector2& vec2);
Friend operator for element-by-element product.
void FVector2::reset(void);
Set elements of vector to default values.
void FVector2::set(double v1, double v2);
Set each element vector to the given values.void FVector2::set(double val);
Set each element vector to the given value.
friend void FVector2::swap(FVector2& vec1, FVector2& vec2);
Swap the elements of two FVector2s.
virtual FVector2::~FVector2();
The virtual destructor does nothing.