The Fast Light Environment Kit



class FVector2

Class Hierarchy

FBase
   |
   +----FVector2

Include Files

#include <Flek/FVector2.H>

Description

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.

Methods


Method Descriptions

FBase

virtual FVector2::FBase(void);

Make a copy of the object.

FVector2

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.

copy_from

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,

fill_array

void FVector2::fill_array(double arr[2]);

Fill an array with the elements of the vector.

get

void FVector2::get(double& v1, double& v2);

Get the elements of vector into given values.

length

double FVector2::length();

Length (norm) of the vector.

norm

friend double FVector2::norm(const FVector2& vec);

Norm of the vector.

normalize

friend double FVector2::normalize(FVector2& vec);

Normalize. Returns previous norm.

normalized

friend FVector2 FVector2::normalized(const FVector2& vec);

Returns normalized vector.

normsqr

friend double FVector2::normsqr(const FVector2& vec);

Square of the norm of the vector.

operator !=

bool FVector2::operator !=(const FVector2& vec);

Boolean ineqality operator.

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.

operator *=

void FVector2::operator *=(double scalar);

Arithmetic operator for multiplicative (scalar) assignment.

operator +

FVector2 FVector2::operator +(const FVector2& vec);

Arithmetic operator for addition.

operator +=

void FVector2::operator +=(const FVector2& vec);

Arithmetic operator for additive assignment.

operator -

FVector2 FVector2::operator -(const FVector2& vec);

Arithmetic operator for subtraction.

friend FVector2 FVector2::operator -(const FVector2& vec);

Friend operator for negation.

operator -=

void FVector2::operator -=(const FVector2& vec);

Arithmetic operator for subtractive assignment.

operator /

friend FVector2 FVector2::operator /(const FVector2& vec, double scalar);

Friend operator for scalar division.

operator /=

void FVector2::operator /=(double scalar);

Arithmetic operator for divisive (scalar) assignment.

operator <<

friend ostream& FVector2::operator <<(ostream& o, const FVector2& vec);

I/O Stream insertion operator. Of the form "[ x y z ]".

operator =

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.

operator ==

bool FVector2::operator ==(const FVector2& vec);

Boolean equality operator.

operator >>

friend istream& FVector2::operator >>(istream& i, FVector2& vec);

I/O Stream extraction operator. Of the form "[ x y ]".

operator []

double& FVector2::operator [] (uint index);

Element access operator. For efficiency, this doesn't check for valid indices

double FVector2::operator [] (uint index);

Element access operator. For efficiency, this doesn't check for valid indices

product

friend FVector2 FVector2::product(const FVector2& vec1, const FVector2& vec2);

Friend operator for element-by-element product.

reset

void FVector2::reset(void);

Set elements of vector to default values.

set

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.

swap

friend void FVector2::swap(FVector2& vec1, FVector2& vec2);

Swap the elements of two FVector2s.

~FVector2

virtual FVector2::~FVector2();

The virtual destructor does nothing.

© 2000 the Flek Development team.
Generated by ScanDoc
Last Updated: Tue May 15 8:50:06 2001