Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vector3d Class Reference

#include <vector3d.h>

Public Member Functions

 vector3d (void)
 
 vector3d (const real init)
 
 vector3d (int init)
 
 vector3d (const real Nx, const real Ny, const real Nz)
 
 vector3d (const real *arr)
 
 vector3d (const vector3d &copy)
 
 vector3d (const polar3d &p)
 
vector3doperator= (const vector3d &b)
 
 operator real * ()
 
 operator const real * () const
 
int operator== (const vector3d &b) const
 
int operator!= (const vector3d &b) const
 
vector3d operator+ (const vector3d &b) const
 
vector3d operator- (const vector3d &b) const
 
vector3d operator* (const real scale) const
 
vector3d operator/ (const real &div) const
 
vector3d operator- (void) const
 
void operator+= (const vector3d &b)
 
void operator-= (const vector3d &b)
 
void operator*= (const real scale)
 
void operator/= (const real div)
 
real magSqr (void) const
 
real mag (void) const
 
real distSqr (const vector3d &b) const
 
real dist (const vector3d &b) const
 
real dot (const vector3d &b) const
 
real cosAng (const vector3d &b) const
 
vector3d dir (void) const
 
vector3d cross (const vector3d &b) const
 
real max (void)
 
void enlarge (const vector3d &by)
 

Public Attributes

real x
 
real y
 
real z
 

Friends

vector3d operator* (const real scale, const vector3d &v)
 

Detailed Description

Definition at line 86 of file vector3d.h.

Constructor & Destructor Documentation

vector3d ( void  )
inline

Definition at line 89 of file vector3d.h.

Referenced by cross(), operator*(), operator+(), operator-(), and operator/().

89 {}//Default consructor

Here is the caller graph for this function:

vector3d ( const real  init)
inlineexplicit

Definition at line 91 of file vector3d.h.

References x, y, and z.

91 {x=y=z=init;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d ( int  init)
inlineexplicit

Definition at line 93 of file vector3d.h.

References x, y, and z.

93 {x=y=z=init;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d ( const real  Nx,
const real  Ny,
const real  Nz 
)
inline

Definition at line 95 of file vector3d.h.

References x, y, and z.

95 {x=Nx;y=Ny;z=Nz;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d ( const real arr)
inline

Definition at line 97 of file vector3d.h.

References x, y, and z.

97 {x=arr[0];y=arr[1];z=arr[2];}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d ( const vector3d copy)
inline

Definition at line 99 of file vector3d.h.

References x, y, and z.

99 {x=copy.x;y=copy.y;z=copy.z;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d ( const polar3d p)

Member Function Documentation

real cosAng ( const vector3d b) const
inline

Definition at line 141 of file vector3d.h.

References dot(), and mag().

141 {return dot(b)/(mag()*b.mag());}
real mag(void) const
Definition: vector3d.h:130
real dot(const vector3d &b) const
Definition: vector3d.h:139

Here is the call graph for this function:

vector3d cross ( const vector3d b) const
inline

Definition at line 146 of file vector3d.h.

References vector3d(), x, y, and z.

Referenced by checkQuality().

146  {
147  return vector3d(y*b.z-z*b.y,z*b.x-x*b.z,x*b.y-y*b.x);
148  }
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
vector3d(void)
Definition: vector3d.h:89
real z
Definition: vector3d.h:88

Here is the call graph for this function:

Here is the caller graph for this function:

vector3d dir ( void  ) const
inline
real dist ( const vector3d b) const
inline

Definition at line 136 of file vector3d.h.

References distSqr(), and sqrt().

Referenced by checkQuality().

136 {return sqrt(distSqr(b));}
double sqrt(double d)
Definition: double.h:73
real distSqr(const vector3d &b) const
Definition: vector3d.h:133

Here is the call graph for this function:

Here is the caller graph for this function:

real distSqr ( const vector3d b) const
inline

Definition at line 133 of file vector3d.h.

References x, y, and z.

Referenced by dist().

134  {return (x-b.x)*(x-b.x)+(y-b.y)*(y-b.y)+(z-b.z)*(z-b.z);}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88

Here is the caller graph for this function:

real dot ( const vector3d b) const
inline

Definition at line 139 of file vector3d.h.

References x, y, and z.

Referenced by cosAng(), halfspace3d::halfspace3d(), halfspace3d::init(), halfspace3d::intersect(), and halfspace3d::side().

139 {return x*b.x+y*b.y+z*b.z;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88

Here is the caller graph for this function:

void enlarge ( const vector3d by)
real mag ( void  ) const
inline

Definition at line 130 of file vector3d.h.

References magSqr(), and sqrt().

Referenced by hashableVector3d::checkVector(), cosAng(), and dir().

130 {return sqrt(magSqr());}
double sqrt(double d)
Definition: double.h:73
real magSqr(void) const
Definition: vector3d.h:128

Here is the call graph for this function:

Here is the caller graph for this function:

real magSqr ( void  ) const
inline

Definition at line 128 of file vector3d.h.

References x, y, and z.

Referenced by mag().

128 {return x*x+y*y+z*z;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88

Here is the caller graph for this function:

real max ( void  )
inline

Definition at line 151 of file vector3d.h.

References x, y, and z.

Referenced by checkQuality().

151  {
152  real big=x;
153  if (big<y) big=y;
154  if (big<z) big=z;
155  return big;
156  }
float real
Definition: gridutil.h:70
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88

Here is the caller graph for this function:

operator const real * ( ) const
inline

Definition at line 107 of file vector3d.h.

References x.

107 {return (const real *)&x;}
float real
Definition: gridutil.h:70
real x
Definition: vector3d.h:88
operator real * ( )
inline

Definition at line 106 of file vector3d.h.

References x.

106 {return (real *)&x;}
float real
Definition: gridutil.h:70
real x
Definition: vector3d.h:88
int operator!= ( const vector3d b) const
inline

Definition at line 111 of file vector3d.h.

References x, y, and z.

111 {return (x!=b.x)||(y!=b.y)||(z!=b.z);}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d operator* ( const real  scale) const
inline

Definition at line 114 of file vector3d.h.

References vector3d(), x, y, and z.

115  {return vector3d(x*scale,y*scale,z*scale);}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
vector3d(void)
Definition: vector3d.h:89
real z
Definition: vector3d.h:88

Here is the call graph for this function:

void operator*= ( const real  scale)
inline

Definition at line 123 of file vector3d.h.

References x, y, and z.

123 {x*=scale;y*=scale;z*=scale;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d operator+ ( const vector3d b) const
inline

Definition at line 112 of file vector3d.h.

References vector3d(), x, y, and z.

112 {return vector3d(x+b.x,y+b.y,z+b.z);}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
vector3d(void)
Definition: vector3d.h:89
real z
Definition: vector3d.h:88

Here is the call graph for this function:

void operator+= ( const vector3d b)
inline

Definition at line 121 of file vector3d.h.

References x, y, and z.

121 {x+=b.x;y+=b.y;z+=b.z;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d operator- ( const vector3d b) const
inline

Definition at line 113 of file vector3d.h.

References vector3d(), x, y, and z.

113 {return vector3d(x-b.x,y-b.y,z-b.z);}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
vector3d(void)
Definition: vector3d.h:89
real z
Definition: vector3d.h:88

Here is the call graph for this function:

vector3d operator- ( void  ) const
inline

Definition at line 120 of file vector3d.h.

References vector3d(), x, y, and z.

120 {return vector3d(-x,-y,-z);}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
vector3d(void)
Definition: vector3d.h:89
real z
Definition: vector3d.h:88

Here is the call graph for this function:

void operator-= ( const vector3d b)
inline

Definition at line 122 of file vector3d.h.

References x, y, and z.

122 {x-=b.x;y-=b.y;z-=b.z;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d operator/ ( const real div) const
inline

Definition at line 118 of file vector3d.h.

References vector3d(), x, y, and z.

119  {real scale=1.0/div;return vector3d(x*scale,y*scale,z*scale);}
float real
Definition: gridutil.h:70
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
vector3d(void)
Definition: vector3d.h:89
real z
Definition: vector3d.h:88

Here is the call graph for this function:

void operator/= ( const real  div)
inline

Definition at line 124 of file vector3d.h.

References x, y, and z.

124 {real scale=1.0/div;x*=scale;y*=scale;z*=scale;}
float real
Definition: gridutil.h:70
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
vector3d& operator= ( const vector3d b)
inline

Definition at line 102 of file vector3d.h.

References x, y, and z.

102 {x=b.x;y=b.y;z=b.z;return *this;}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88
int operator== ( const vector3d b) const
inline

Definition at line 110 of file vector3d.h.

References x, y, and z.

110 {return (x==b.x)&&(y==b.y)&&(z==b.z);}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
real z
Definition: vector3d.h:88

Friends And Related Function Documentation

vector3d operator* ( const real  scale,
const vector3d v 
)
friend

Definition at line 116 of file vector3d.h.

117  {return vector3d(v.x*scale,v.y*scale,v.z*scale);}
real x
Definition: vector3d.h:88
real y
Definition: vector3d.h:88
vector3d(void)
Definition: vector3d.h:89
real z
Definition: vector3d.h:88

Member Data Documentation


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