zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Vector2f Class Reference

A 2-Space Vector Class. More...

#include <Vector2f.h>

Public Member Functions

 Vector2f (const bool &degenerate_=false)
 The best way to create a Vector3f. More...
 
 Vector2f (const float &i_, const float &j_, const bool &degenerate_=false)
 
 Vector2f (const Vector2f &rhs, const bool &degenerate_=false)
 
 Vector2f (const Point2f &rhs)
 
 Vector2f (const Vector3f &rhs)
 
float angle_between (const Vector2f &rhs) const
 Find the angle between the Vector3fs. More...
 
Vector2f divide_by (const Vector2f &rhs) const
 Divide corresponding members. More...
 
Vector2f get_i () const
 Get just the i-part. More...
 
Vector2f get_j () const
 Get just the j-part. More...
 
float magnitude () const
 Get the magnitude of the vector. More...
 
float magnitude2 () const
 Get the 'magnitude squared' of the vector. More...
 
Vector2f multiply_by (const Vector2f &rhs) const
 Multiply corresponding members. More...
 
Vector2fnormalize ()
 Normalize the vector. More...
 
Vector2f normalized () const
 Get the normalized vector. More...
 
float operator* (const Vector2f &rhs) const
 Get the dot-product. More...
 
Vector2f operator* (const float &rhs) const
 Get the scalar multiple. More...
 
Vector2foperator*= (const float &rhs)
 Set equal to the scalar multiple. More...
 
Vector2f operator+ (const Vector2f &rhs) const
 Get the sum. More...
 
Vector2foperator+= (const Vector2f &rhs)
 Set equal to the sum. More...
 
Vector2f operator- (const Vector2f &rhs) const
 Get the difference. More...
 
Vector2f operator- () const
 Get the negation. More...
 
Vector2foperator-= (const Vector2f &rhs)
 Set equal to the difference. More...
 
Vector2f operator/ (const float &rhs) const
 Get the scalar... something. More...
 
Vector2foperator/= (const float &rhs)
 Set equal to the scalar something. More...
 
const float & operator[] (const int &index) const
 Get 'index'. More...
 
float & operator[] (const int &index)
 Get 'index'. More...
 
void set_spherical (const float &theta, const float &magnitude=1)
 Set the vector using spherical coordinates. More...
 
float theta () const
 theta == radians north of vector i More...
 

Public Attributes

union {
   float   i
 
   float   x
 
}; 
 
union {
   float   j
 
   float   y
 
}; 
 
bool degenerate
 

Detailed Description

A 2-Space Vector Class.

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 41 of file Vector2f.h.

Constructor & Destructor Documentation

Zeni::Vector2f::Vector2f ( const bool &  degenerate_ = false)
inlineexplicit

The best way to create a Vector3f.

Definition at line 33 of file Vector2f.hxx.

Referenced by divide_by(), get_i(), get_j(), multiply_by(), normalized(), operator*(), operator+(), operator-(), and operator/().

Zeni::Vector2f::Vector2f ( const float &  i_,
const float &  j_,
const bool &  degenerate_ = false 
)
inline

Definition at line 38 of file Vector2f.hxx.

Zeni::Vector2f::Vector2f ( const Vector2f rhs,
const bool &  degenerate_ = false 
)
inline

Definition at line 43 of file Vector2f.hxx.

Zeni::Vector2f::Vector2f ( const Point2f rhs)
inline

Definition at line 48 of file Vector2f.hxx.

Zeni::Vector2f::Vector2f ( const Vector3f rhs)
inlineexplicit

Definition at line 53 of file Vector2f.hxx.

Member Function Documentation

float Zeni::Vector2f::angle_between ( const Vector2f rhs) const
inline

Find the angle between the Vector3fs.

Definition at line 143 of file Vector2f.hxx.

References magnitude().

Vector2f Zeni::Vector2f::divide_by ( const Vector2f rhs) const
inline

Divide corresponding members.

Definition at line 139 of file Vector2f.hxx.

References degenerate, i, j, and Vector2f().

Vector2f Zeni::Vector2f::get_i ( ) const
inline

Get just the i-part.

Definition at line 127 of file Vector2f.hxx.

References i, and Vector2f().

Vector2f Zeni::Vector2f::get_j ( ) const
inline

Get just the j-part.

Definition at line 131 of file Vector2f.hxx.

References j, and Vector2f().

float Zeni::Vector2f::magnitude ( ) const
inline

Get the magnitude of the vector.

Definition at line 123 of file Vector2f.hxx.

References magnitude2().

Referenced by angle_between(), normalize(), normalized(), and set_spherical().

float Zeni::Vector2f::magnitude2 ( ) const
inline

Get the 'magnitude squared' of the vector.

Definition at line 119 of file Vector2f.hxx.

References i, and j.

Referenced by magnitude().

Vector2f Zeni::Vector2f::multiply_by ( const Vector2f rhs) const
inline

Multiply corresponding members.

Definition at line 135 of file Vector2f.hxx.

References degenerate, i, j, and Vector2f().

Vector2f & Zeni::Vector2f::normalize ( )

Normalize the vector.

Definition at line 26 of file Vector2f.cpp.

References degenerate, i, INFINTESSIMAL, j, and magnitude().

Vector2f Zeni::Vector2f::normalized ( ) const

Get the normalized vector.

Definition at line 44 of file Vector2f.cpp.

References i, INFINTESSIMAL, j, magnitude(), and Vector2f().

float Zeni::Vector2f::operator* ( const Vector2f rhs) const
inline

Get the dot-product.

Definition at line 84 of file Vector2f.hxx.

References i, and j.

Vector2f Zeni::Vector2f::operator* ( const float &  rhs) const
inline

Get the scalar multiple.

Definition at line 90 of file Vector2f.hxx.

References degenerate, i, j, and Vector2f().

Vector2f & Zeni::Vector2f::operator*= ( const float &  rhs)
inline

Set equal to the scalar multiple.

Definition at line 98 of file Vector2f.hxx.

References i, and j.

Vector2f Zeni::Vector2f::operator+ ( const Vector2f rhs) const
inline

Get the sum.

Definition at line 58 of file Vector2f.hxx.

References degenerate, i, j, and Vector2f().

Vector2f & Zeni::Vector2f::operator+= ( const Vector2f rhs)
inline

Set equal to the sum.

Definition at line 70 of file Vector2f.hxx.

References degenerate, i, and j.

Vector2f Zeni::Vector2f::operator- ( const Vector2f rhs) const
inline

Get the difference.

Definition at line 64 of file Vector2f.hxx.

References degenerate, i, j, and Vector2f().

Vector2f Zeni::Vector2f::operator- ( ) const
inline

Get the negation.

Definition at line 110 of file Vector2f.hxx.

Vector2f & Zeni::Vector2f::operator-= ( const Vector2f rhs)
inline

Set equal to the difference.

Definition at line 77 of file Vector2f.hxx.

References degenerate, i, and j.

Vector2f Zeni::Vector2f::operator/ ( const float &  rhs) const
inline

Get the scalar... something.

Definition at line 94 of file Vector2f.hxx.

References degenerate, i, j, and Vector2f().

Vector2f & Zeni::Vector2f::operator/= ( const float &  rhs)
inline

Set equal to the scalar something.

Definition at line 104 of file Vector2f.hxx.

References i, and j.

const float & Zeni::Vector2f::operator[] ( const int index) const
inline

Get 'index'.

Definition at line 151 of file Vector2f.hxx.

References assert, and i.

float & Zeni::Vector2f::operator[] ( const int index)
inline

Get 'index'.

Definition at line 157 of file Vector2f.hxx.

References assert, and i.

void Zeni::Vector2f::set_spherical ( const float &  theta,
const float &  magnitude = 1 
)

Set the vector using spherical coordinates.

Definition at line 67 of file Vector2f.cpp.

References cos(), degenerate, i, j, magnitude(), and sin().

float Zeni::Vector2f::theta ( ) const

theta == radians north of vector i

Definition at line 55 of file Vector2f.cpp.

References atan(), i, j, Zeni::Global::pi, Zeni::Global::pi_over_two, and Zeni::Global::three_pi_over_two.

Member Data Documentation

union { ... }
union { ... }
bool Zeni::Vector2f::degenerate
float Zeni::Vector2f::x

Definition at line 88 of file Vector2f.h.

float Zeni::Vector2f::y

Definition at line 92 of file Vector2f.h.


The documentation for this class was generated from the following files: