cgma
CubitVector.cpp File Reference
`#include <math.h>`
`#include "CubitVector.hpp"`
`#include <string>`
`#include <stdexcept>`
`#include "CubitPlane.hpp"`
`#include "GeometryDefines.h"`
`#include "CubitBox.hpp"`

Go to the source code of this file.

## Defines

#define DETERM3(p1, q1, p2, q2, p3, q3)

## Functions

CubitVector vectorRotate (const double angle, const CubitVector &normalAxis, const CubitVector &referenceAxis)

## Variables

const double PI = 3.14159265358979323846
const double TWO_PI = 2.0 * PI

## Define Documentation

 #define DETERM3 ( p1, q1, p2, q2, p3, q3 )
Value:
```((q3)*((p2)-(p1)) + \
(q2)*((p1)-(p3)) + \
(q1)*((p3)-(p2)))
```

## Function Documentation

 CubitVector vectorRotate ( const double angle, const CubitVector & normalAxis, const CubitVector & referenceAxis )

Definition at line 265 of file CubitVector.cpp.

```{
// A new coordinate system is created with the xy plane corresponding
// to the plane normal to the normal axis, and the x axis corresponding to
// the projection of the reference axis onto the normal plane.  The normal
// plane is the tangent plane at the root point.  A unit vector is
// constructed along the local x axis and then rotated by the given
// ccw angle to form the new point.  The new point, then is a unit
// distance from the global origin in the tangent plane.

double x, y;

// project a unit distance from root along reference axis

CubitVector yAxis = normalAxis * referenceAxis;
CubitVector xAxis = yAxis * normalAxis;
yAxis.normalize();
xAxis.normalize();

x = cos(angle);
y = sin(angle);

xAxis *= x;
yAxis *= y;
return CubitVector(xAxis + yAxis);
}
```

## Variable Documentation

 const double PI = 3.14159265358979323846

Definition at line 19 of file CubitVector.cpp.

 const double TWO_PI = 2.0 * PI

Definition at line 21 of file CubitVector.cpp.