ajvector.c


Section: 3-D vector Constructors

All constructors return a new vector by pointer. It is the responsibility of the user to first destroy any previous vector. The target pointer does not need to be initialised to NULL, but it is good programming practice to do so anyway.

Functions:
aj3dVectorNewDefault constructor for zeroed AJAX 3D vectors.
aj3dVectorCreateConstructor for initialised AJAX 3D vectors.


Function aj3dVectorNew

Default constructor for zeroed AJAX 3D vectors.

Prototype

AjP3dVector aj3dVectorNew (
      void
);

TypeNameRead/WriteDescription
AjP3dVector RETURNPointer to a zeroed 3D vector

From EMBOSS 2.8.0


Function aj3dVectorCreate

Constructor for initialised AJAX 3D vectors.

Prototype

AjP3dVector aj3dVectorCreate (
      float fX,
      float fY,
      float fZ
);

TypeNameRead/WriteDescription
floatfXInputx component of 3D vector
floatfYInputy component of 3D vector
floatfZInputz component of 3D vector
AjP3dVector RETURNPointer to an initialised 3D vector

From EMBOSS 2.8.0


Section: 3D Vector Destructors

Destruction is achieved by deleting the pointer to the 3-D vector and freeing the associated memory

Functions:
aj3dVectorDelDefault destructor for Ajax 3-D Vectors.


Function aj3dVectorDel

Default destructor for Ajax 3-D Vectors.

Prototype

void aj3dVectorDel (
      AjP3dVector* pthis
);

TypeNameRead/WriteDescription
AjP3dVector*pthisDeletePointer to the 3-D vector to be deleted. The pointer is always deleted.
void RETURN

From EMBOSS 2.8.0


Section: 3D Vector Functions

General functions

Functions:
aj3dVectorCrossProductcalculates the cross product of two 3D vectors, that is their "torque"
aj3dVectorBetweenPointsCalculates the vector from one point in space (start) to another (end)
aj3dVectorLengthcalculates the magnitude of a vector
aj3dVectorAngleCalculates the angle between two vectors
aj3dVectorDihedralAnglecalculates the angle from the plane perpendicular to A x B to the plane perpendicular to B x C (where A, B and C are vectors)
aj3dVectorDotProductcalculates the dot product of two 3D vectors, that is their summed common scalar magnitude
aj3dVectorSumcalculates the dot product of two 3D vectors, that is their summed common "scalar magnitude"


Function aj3dVectorCrossProduct

calculates the cross product of two 3D vectors, that is their "torque"

Prototype

void aj3dVectorCrossProduct (
      const AjP3dVector first,
      const AjP3dVector second,
      AjP3dVector crossProduct
);

TypeNameRead/WriteDescription
const AjP3dVectorfirstInputfirst 3D vector
const AjP3dVectorsecondInputsecond 3D vector
AjP3dVectorcrossProductOutput3D vector to contain cross product
void RETURN

From EMBOSS 2.8.0


Function aj3dVectorBetweenPoints

Calculates the vector from one point in space (start) to another (end)

Prototype

void aj3dVectorBetweenPoints (
      AjP3dVector betweenPoints,
      float fStartX,
      float fStartY,
      float fStartZ,
      float fEndX,
      float fEndY,
      float fEndZ
);

TypeNameRead/WriteDescription
AjP3dVectorbetweenPointsModifyvector from start to end
floatfStartXInputX coordinate of start
floatfStartYInputY coordinate of start
floatfStartZInputZ coordinate of start
floatfEndXInputX coordinate of end
floatfEndYInputY coordinate of end
floatfEndZInputZ coordinate of end
void RETURN

From EMBOSS 2.8.0


Function aj3dVectorLength

calculates the magnitude of a vector

Prototype

float aj3dVectorLength (
      const AjP3dVector thys
);

TypeNameRead/WriteDescription
const AjP3dVectorthysInputvector to be sized
float RETURNlength of vector to be sized

From EMBOSS 2.8.0


Function aj3dVectorAngle

Calculates the angle between two vectors

Prototype

float aj3dVectorAngle (
      const AjP3dVector first,
      const AjP3dVector second
);

TypeNameRead/WriteDescription
const AjP3dVectorfirstInputfirst vector
const AjP3dVectorsecondInputsecond vector
float RETURNangle between vectors in degrees

From EMBOSS 2.8.0


Function aj3dVectorDihedralAngle

calculates the angle from the plane perpendicular to A x B to the plane perpendicular to B x C (where A, B and C are vectors)

Prototype

float aj3dVectorDihedralAngle (
      const AjP3dVector veca,
      const AjP3dVector vecb,
      const AjP3dVector vecc
);

TypeNameRead/WriteDescription
const AjP3dVectorvecaInputVector A
const AjP3dVectorvecbInputVector B
const AjP3dVectorveccInputVector C
float RETURNdihedral angle

From EMBOSS 2.8.0


Function aj3dVectorDotProduct

calculates the dot product of two 3D vectors, that is their summed common scalar magnitude

Prototype

float aj3dVectorDotProduct (
      const AjP3dVector first,
      const AjP3dVector second
);

TypeNameRead/WriteDescription
const AjP3dVectorfirstInputfirst vector
const AjP3dVectorsecondInputsecond vector
float RETURNdot product of first and second vectors

From EMBOSS 2.8.0


Function aj3dVectorSum

calculates the dot product of two 3D vectors, that is their summed common "scalar magnitude"

Prototype

void aj3dVectorSum (
      const AjP3dVector first,
      const AjP3dVector second,
      AjP3dVector sum
);

TypeNameRead/WriteDescription
const AjP3dVectorfirstInputfirst vector
const AjP3dVectorsecondInputsecond vector
AjP3dVectorsumOutputsum of first and second vectors
void RETURN

From EMBOSS 2.8.0