Back to index

salome-gui  6.5.0
Public Member Functions | Private Attributes
Vec Class Reference

Class for the representation Vector in the 3D space. More...

#include <VTKViewer_ArcBuilder.h>

Collaboration diagram for Vec:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Vec (const double Xv, const double Yv, const double Zv)
 Class Vec Constructor.
 ~Vec ()
 Destructor.
XYZ GetXYZ () const
double AngleBetween (const Vec &Other)
 Calculate angle between vectors in radians.
double AngleBetweenInGrad (const Vec &Other)
 Calculate angle between vectors in degrees.
Vec VectMultiplication (const Vec &Other) const

Private Attributes

XYZ coord

Detailed Description

Class for the representation Vector in the 3D space.

Definition at line 103 of file VTKViewer_ArcBuilder.h.


Constructor & Destructor Documentation

Vec::Vec ( const double  Xv,
const double  Yv,
const double  Zv 
)

Class Vec Constructor.

Definition at line 113 of file VTKViewer_ArcBuilder.cxx.

{
  double D = sqrt (Xv * Xv + Yv * Yv + Zv * Zv);
  if(D != 0) {
    coord.SetX(Xv / D);
    coord.SetY(Yv / D);
    coord.SetZ(Zv / D);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Vec::~Vec ( )

Destructor.

Definition at line 128 of file VTKViewer_ArcBuilder.cxx.

{}

Member Function Documentation

double Vec::AngleBetween ( const Vec Other)

Calculate angle between vectors in radians.

Definition at line 134 of file VTKViewer_ArcBuilder.cxx.

{
  double res;
  double numerator = GetXYZ().X()*Other.GetXYZ().X()+GetXYZ().Y()*Other.GetXYZ().Y()+GetXYZ().Z()*Other.GetXYZ().Z();
  double denumerator = GetXYZ().Modulus()*Other.GetXYZ().Modulus();
  double d = numerator/denumerator;
  if( d < -1 && d > -1 - PRECISION )
    d = -1;
  else if( d > 1 && d < 1 + PRECISION )
    d = 1;
  res = acos( d );
  return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

double Vec::AngleBetweenInGrad ( const Vec Other)

Calculate angle between vectors in degrees.

Definition at line 151 of file VTKViewer_ArcBuilder.cxx.

                                               {
  return AngleBetween(Other)*vtkMath::DegreesFromRadians(1.);
}

Here is the call graph for this function:

Here is the caller graph for this function:

XYZ Vec::GetXYZ ( ) const [inline]

Definition at line 109 of file VTKViewer_ArcBuilder.h.

{return coord;}

Here is the caller graph for this function:

Vec Vec::VectMultiplication ( const Vec Other) const

Definition at line 158 of file VTKViewer_ArcBuilder.cxx.

                                                  {
  double x = GetXYZ().Y()*Other.GetXYZ().Z() - GetXYZ().Z()*Other.GetXYZ().Y();
  double y = GetXYZ().Z()*Other.GetXYZ().X() - GetXYZ().X()*Other.GetXYZ().Z();
  double z = GetXYZ().X()*Other.GetXYZ().Y() - GetXYZ().Y()*Other.GetXYZ().X();
  Vec *aRes  = new Vec(x,y,z);
  return *aRes;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

XYZ Vec::coord [private]

Definition at line 117 of file VTKViewer_ArcBuilder.h.


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