CCL Home Page
Up Directory CCL vectors.h
/**************************************************************************/
/******************  vector calculation aids  *****************************/
/**************************************************************************/

#ifndef PI
#define PI       3.14159265358979323846
#endif
#ifndef PI_2
#define PI_2     1.57079632679489661923
#endif

struct vector { double x,y,z; };
typedef struct vector Vector;

struct matrix { Vector x,y,z; };
typedef struct matrix Matrix;

Vector Vdif(Vector u, Vector v);

Vector Vsum(Vector u, Vector v);

Vector unit_vector(Vector v);

double dot_product(Vector u, Vector v);

Vector cross_product(Vector u, Vector v);

double Vmag(Vector v);

double VangleV(Vector u, Vector v);

Vector SxV(double s, Vector v);

Matrix SxM(double s, Matrix M);

Vector VequalV(Vector v);

Vector Vequal(double x, double y, double z);

int Vcmp(Vector u, Vector v);

Matrix Mtranspose(Matrix A);

Vector Mtransform(Matrix R, Vector u);

double SDLP(Vector line, Vector v);

Vector average_direction(int n, Vector v[]);

double Get_Vector_Theta(Vector v);

double Get_Vector_Phi(Vector v);

Vector Rotate_About_X(Vector u, double angle);

Vector Rotate_About_Y(Vector u, double angle);

Vector Rotate_About_Z(Vector u, double angle);

Vector Rotate_Vector(Vector u, double theta, double phi);

void Rotate_Indices_Right(Vector *v);

void Rotate_Indices_Left(Vector *v);

double seperate(struct vector A, struct vector B);

Vector Vwrap(struct vector v, struct vector lo, struct vector hi);

Vector *Reciprocal_Vector(Vector *V);

Matrix *Reciprocal_Matrix(Matrix *M);
Modified: Fri Dec 8 17:00:00 1995 GMT
Page accessed 5444 times since Sat Apr 17 22:00:02 1999 GMT