PMath Class Reference

#include <PExtension.h>

List of all members.


Detailed Description

Contains mathematical functions needed in various LoopTK computations, such as cyclic coordinate descent (CCD) and chain manipulations.


Static Public Member Functions

static Real AngleBetweenPlanes (const Vector3 &p1, const Vector3 &p2, const Vector3 &p3, const Vector3 &p4)
static Real getAngle (const Vector3 &v1, const Vector3 &v2)
static Vector3 ComputePos (const Vector3 &prev, const Vector3 &cur, Real angle, Real bondLength)
static bool sphereIntersectsCube (const Vector3 &sphereCenter, Real sphereRadius, const Vector3 &cubeVertex1, const Vector3 &cubeVertex2)
static Vector3 ArbitraryNonParallel (const Vector3 &v)
static void normalize (vector< double > &v)
static Matrix4 Find2PtTransform (Vector3 s1, Vector3 s2, Vector3 e1, Vector3 e2)
static Matrix3 FindRotationMatrix (const Vector3 &axis, Real angle)
static Vector3 LocalToGlobalCoord (const vector< Vector3 > definedRelativeCoordinates, const vector< Vector3 > definedGlobalCoordinates)
static void ConvertToQuaternion (double **input, Vector4 *output, vector< int > sign)
static void InterpolateQuaternion (Vector4 qi, Vector4 qf, Vector4 *qu, double u)
static void DeltaQuaterToDeltaVel (Vector4 qi, Vector4 qf, Vector3 *delatV)
static int signum (double a)
static double TorsionAngle (Vector3 u, Vector3 v, Vector3 w)


Member Function Documentation

Real PMath::AngleBetweenPlanes ( const Vector3 &  p1,
const Vector3 &  p2,
const Vector3 &  p3,
const Vector3 &  p4 
) [static]

Computes the angle between the planes determined by the specified four points.

Real PMath::getAngle ( const Vector3 &  v1,
const Vector3 &  v2 
) [static]

Computes the angle (in radians) between vectors v1 and v2.

Vector3 PMath::ComputePos ( const Vector3 &  prev,
const Vector3 &  cur,
Real  angle,
Real  bondLength 
) [static]

Computes the position of the point "next" given points prev and cur, the angle prev-cur-next, and the distance between cur and next.

bool PMath::sphereIntersectsCube ( const Vector3 &  sphereCenter,
Real  sphereRadius,
const Vector3 &  cubeVertex1,
const Vector3 &  cubeVertex2 
) [static]

Returns true if the sphere with specified center and radius intersects any part of the cube with the specified pair of opposing vertices.

Vector3 PMath::ArbitraryNonParallel ( const Vector3 &  v  )  [static]

Given the vector v, computes and returns a vector not parallel to v.

void PMath::normalize ( vector< double > &  v  )  [static]

Divides each element in v by the sum of all elements in v.

Matrix4 PMath::Find2PtTransform ( Vector3  s1,
Vector3  s2,
Vector3  e1,
Vector3  e2 
) [static]

Matrix3 PMath::FindRotationMatrix ( const Vector3 &  axis,
Real  angle 
) [static]

Finds and returns a rotation matrix for rotating a vector the specified number of radians around the specified axis according to left-hand rule.

Vector3 PMath::LocalToGlobalCoord ( const vector< Vector3 >  definedRelativeCoordinates,
const vector< Vector3 >  definedGlobalCoordinates 
) [static]

Converts the vector of defined relative coordinates into a vector of global coordinates.

void PMath::ConvertToQuaternion ( double **  input,
Vector4 *  output,
vector< int >  sign 
) [static]

Converts a 3X3 rotation matrix specified by input to a quaternion vector returned in output.

void PMath::InterpolateQuaternion ( Vector4  qi,
Vector4  qf,
Vector4 *  qu,
double  u 
) [static]

Interpolates between two quaternions specified by qi and qf and returns the interpolated quternion in qu. u ranges from 0.0 to 1.0

void PMath::DeltaQuaterToDeltaVel ( Vector4  qi,
Vector4  qf,
Vector3 *  delatV 
) [static]

Converts a change in quaternion space specified by difference between qi and qf to a change in velocity space and returns it in deltaV.

int PMath::signum ( double  a  )  [static]

Returns the signum of a

double PMath::TorsionAngle ( Vector3  u,
Vector3  v,
Vector3  w 
) [static]

returns the torsion angle between the plane defined by vectors w and u and the plane defined by vectors w and v.


The documentation for this class was generated from the following files:
Generated on Wed May 16 20:22:14 2007 for LoopTK: Protein Loop Kinematic Toolkit by  doxygen 1.5.1