moab
CartVect Class Reference

List of all members.

Public Member Functions

 CartVect ()
 CartVect (double tx, double ty, double tz)
 CartVect (const CartVect &other)
void set (double tx, double ty, double tz)
void set (const double *c)
double x () const
double y () const
double z () const
CartVectoperator+= (const CartVect &other)
CartVectoperator-= (const CartVect &other)
CartVectoperator*= (const CartVect &other)
double lensqr () const
double len () const
CartVect operator~ () const
CartVectoperator*= (double a)
CartVectoperator/= (double a)

Private Attributes

double coords [3]

Detailed Description

Definition at line 30 of file measure.cpp.


Constructor & Destructor Documentation

CartVect::CartVect ( ) [inline]

Definition at line 36 of file measure.cpp.

{}
CartVect::CartVect ( double  tx,
double  ty,
double  tz 
) [inline]

Definition at line 38 of file measure.cpp.

{ set(tx,ty,tz); }
CartVect::CartVect ( const CartVect other) [inline]

Definition at line 40 of file measure.cpp.

{ set( other.coords); }

Member Function Documentation

double CartVect::len ( ) const [inline]

Definition at line 134 of file measure.cpp.

      { return sqrt(lensqr()); }
double CartVect::lensqr ( ) const [inline]

Definition at line 131 of file measure.cpp.

      { return *this % *this; }
CartVect & CartVect::operator*= ( const CartVect other) [inline]

Definition at line 128 of file measure.cpp.

      { return *this = *this * other; }
CartVect& CartVect::operator*= ( double  a) [inline]

Definition at line 77 of file measure.cpp.

    {
      coords[0] *= a;
      coords[1] *= a;
      coords[2] *= a;
      return *this;
    }
CartVect& CartVect::operator+= ( const CartVect other) [inline]

Definition at line 52 of file measure.cpp.

    {
      coords[0] += other.coords[0];
      coords[1] += other.coords[1];
      coords[2] += other.coords[2];
      return *this;
    }
CartVect& CartVect::operator-= ( const CartVect other) [inline]

Definition at line 60 of file measure.cpp.

    {
      coords[0] -= other.coords[0];
      coords[1] -= other.coords[1];
      coords[2] -= other.coords[2];
      return *this;
    }
CartVect& CartVect::operator/= ( double  a) [inline]

Definition at line 85 of file measure.cpp.

    {
      coords[0] /= a;
      coords[1] /= a;
      coords[2] /= a;
      return *this;
    }
CartVect CartVect::operator~ ( ) const [inline]

Definition at line 122 of file measure.cpp.

{
  double invlen = 1.0 / len();
  return CartVect( invlen * x(), invlen * y(), invlen * z() );
}
void CartVect::set ( double  tx,
double  ty,
double  tz 
) [inline]

Definition at line 42 of file measure.cpp.

      { coords[0] = tx; coords[1] = ty; coords[2] = tz; }
void CartVect::set ( const double *  c) [inline]

Definition at line 45 of file measure.cpp.

      { coords[0] = c[0]; coords[1] = c[1]; coords[2] = c[2]; }
double CartVect::x ( ) const [inline]

Definition at line 48 of file measure.cpp.

{ return coords[0]; }
double CartVect::y ( ) const [inline]

Definition at line 49 of file measure.cpp.

{ return coords[1]; }
double CartVect::z ( ) const [inline]

Definition at line 50 of file measure.cpp.

{ return coords[2]; }

Member Data Documentation

double CartVect::coords[3] [private]

Definition at line 32 of file measure.cpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines