NAMD
Macros | Functions
Matrix4.C File Reference
#include <math.h>
#include <string.h>
#include <stdio.h>
#include "Matrix4.h"

Go to the source code of this file.

Macros

#define VMD_PI   3.14159265358979323846
 
#define VMD_TWOPI   (2.0 * VMD_PI)
 
#define DEGTORAD(a)   (a*VMD_PI/180.0)
 
#define RADTODEG(a)   (a*180.0/VMD_PI)
 
#define MATSWAP(a, b)   {temp=(a);(a)=(b);(b)=temp;}
 

Functions

void trans_from_rotate (const double mat3[9], Matrix4 *mat4)
 Transform 3x3 into 4x4 matrix: More...
 
void print_Matrix4 (const Matrix4 *mat4)
 Print formatted matrix. More...
 

Macro Definition Documentation

#define DEGTORAD (   a)    (a*VMD_PI/180.0)

Definition at line 31 of file Matrix4.C.

Referenced by Matrix4::rot().

#define MATSWAP (   a,
 
)    {temp=(a);(a)=(b);(b)=temp;}

Definition at line 109 of file Matrix4.C.

Referenced by Matrix4::inverse().

#define RADTODEG (   a)    (a*180.0/VMD_PI)

Definition at line 32 of file Matrix4.C.

Referenced by Matrix4::rotate_axis(), Matrix4::transvec(), and Matrix4::transvecinv().

#define VMD_PI   3.14159265358979323846

Definition at line 29 of file Matrix4.C.

#define VMD_TWOPI   (2.0 * VMD_PI)

Definition at line 30 of file Matrix4.C.

Function Documentation

void print_Matrix4 ( const Matrix4 mat4)

Print formatted matrix.

Definition at line 379 of file Matrix4.C.

References Matrix4::mat.

379  {
380  int i, j;
381  for (i=0; i<4; i++) {
382  for (j=0; j<4; j++) {
383  printf("%f ", mat4->mat[4*j+i]);
384  }
385  printf("\n");
386  }
387  printf("\n");
388 }
double mat[16]
the matrix itself
Definition: Matrix4.h:33
void trans_from_rotate ( const double  mat3[9],
Matrix4 mat4 
)

Transform 3x3 into 4x4 matrix:

Definition at line 369 of file Matrix4.C.

References Matrix4::mat.

369  {
370  int i;
371  for (i=0; i<3; i++) {
372  mat4->mat[0+i] = mat3[3*i];
373  mat4->mat[4+i] = mat3[3*i+1];
374  mat4->mat[8+i] = mat3[3*i+2];
375  }
376 }
double mat[16]
the matrix itself
Definition: Matrix4.h:33