-
Notifications
You must be signed in to change notification settings - Fork 8
/
rotation.h
executable file
·53 lines (44 loc) · 1.23 KB
/
rotation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
** This is a collection of functions to manipulate matrices and triplets,
** and to calculate rotation matrices and Euler angles.
**
** Copyright (c) 2004-2010 Alexei Podtelezhnikov
*/
/*
********** Data types
*/
typedef double matrix[3][3];
typedef vector triplet[3];
/*
** Triplet and matrix manipulations
*/
void casttriplet(triplet, triplet);
void transset(matrix, triplet);
void matrixvector(vector, matrix, vector);
void vectortriplet(vector, vector, triplet);
void rotation(triplet, matrix, triplet);
void fixtriplet(triplet);
void printout(triplet);
void randvector(vector);
/*
** Rotation matrix and Euler angles
*/
double *sphereframe(vector, triplet, double, double, double);
void rotmatrix(matrix, vector, double);
void eulerset(triplet, double, double, double);
double euler_bend(triplet, triplet);
double euler_twist(triplet, triplet);
double euler_alpha(triplet, triplet);
double euler_beta(triplet, triplet);
double euler_gamma(triplet, triplet);
void tripletcmp(double *, double *, triplet, triplet);
/*
** Complex number multiplication with phase accumulation (2D-rotation)
*/
struct phasor {
double y, x;
int k;
};
struct phasor phasiply(struct phasor, struct phasor);
int rephase(struct phasor *);
double phase(struct phasor);