KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
Math3D::Vector3 Class Reference

A 3D vector class. More...

#include <primitives.h>

Inheritance diagram for Math3D::Vector3:
Geometry::PointRay3D Math3D::EulerAngleRotation Math3D::MomentRotation

Public Member Functions

 Vector3 (const Vector3 &)
 Vector3 (Real x)
 Vector3 (Real x, Real y, Real z)
 Vector3 (const Real *data)
bool operator== (const Vector3 &) const
bool operator!= (const Vector3 &) const
const Vector3operator= (const Vector3 &)
void operator+= (const Vector3 &)
void operator-= (const Vector3 &)
void operator*= (Real)
void operator/= (Real)
Real & operator[] (int)
const Real & operator[] (int) const
 operator Real * ()
 operator const Real * () const
void add (const Vector3 &a, const Vector3 &b)
void sub (const Vector3 &a, const Vector3 &b)
void mul (const Vector3 &a, Real)
void div (const Vector3 &a, Real)
void madd (const Vector3 &b, Real)
Real dot (const Vector3 &a) const
Real distance (const Vector3 &a) const
Real distanceSquared (const Vector3 &a) const
Real norm () const
Real normSquared () const
Real length () const
 = norm
Real minElement (int *index=NULL) const
Real maxElement (int *index=NULL) const
Real minAbsElement (int *index=NULL) const
Real maxAbsElement (int *index=NULL) const
void set (const Vector3 &)
void set (Real x)
void set (Real x, Real y, Real z)
void set (const Real *data)
void setZero ()
void setNegative (const Vector3 &)
void setCross (const Vector3 &, const Vector3 &)
void setNormalized (const Vector3 &)
void setProjection (const Vector3 &, const Vector3 &)
void setMinimum (const Vector3 &, const Vector3 &)
void setMinimum (const Vector3 &)
void setMaximum (const Vector3 &, const Vector3 &)
void setMaximum (const Vector3 &)
void get (Vector3 &) const
void get (Real &x, Real &y, Real &z) const
void get (Real data[3]) const
void getNegative (Vector3 &) const
void getNormalized (Vector3 &) const
void getOrthogonalBasis (Vector3 &xb, Vector3 &yb) const
 calculates two unit vectors orthogonal to this vector (and positively oriented)
void inplaceNegative ()
void inplaceMul (Real)
void inplaceDiv (Real)
void inplaceNormalize ()
bool isZero (Real eps=Zero) const
bool isEqual (const Vector3 &, Real eps=Zero) const
bool Read (File &)
bool Write (File &) const

Public Attributes

union {
   Real   data [3]
   struct {
      Real   x
      Real   y
      Real   z

Detailed Description

A 3D vector class.

The elements can be accessed as (x,y,z), or using square brackets [{0,1,2}].

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