reprap: Deleted example board
[simavr] / examples / shared / libc3 / src / c3quaternion.h
1 /*
2         c3quaternion.h
3
4         Copyright 2008-2012 Michel Pollet <buserror@gmail.com>
5
6         This file is part of libc3.
7
8         libc3 is free software: you can redistribute it and/or modify
9         it under the terms of the GNU General Public License as published by
10         the Free Software Foundation, either version 3 of the License, or
11         (at your option) any later version.
12
13         libc3 is distributed in the hope that it will be useful,
14         but WITHOUT ANY WARRANTY; without even the implied warranty of
15         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16         GNU General Public License for more details.
17
18         You should have received a copy of the GNU General Public License
19         along with libc3.  If not, see <http://www.gnu.org/licenses/>.
20  */
21
22
23 #ifndef __C3QUATERNION_H___
24 #define __C3QUATERNION_H___
25
26 #include <stdbool.h>
27 #include "c3algebra.h"
28
29 typedef struct c3quat {
30   c3vec3  v;    /* vector component */
31   c3f s;                /* scalar component */
32 } c3quat, *c3quatp;
33
34 c3quat
35 c3quat_new();
36 c3quat
37 c3quat_identity();
38
39 c3quat
40 c3quatf(
41                 const c3f x,
42                 const c3f y,
43                 const c3f z,
44                 const c3f w);
45 c3quat
46 c3quat_vec3(
47                 const c3vec3 v,
48                 const c3f s);
49 c3quat
50 c3quat_vec4(
51                 const c3vec4 v);
52
53 c3quat
54 c3quat_double(
55                 const double *d);
56
57 c3quat
58 c3quat_add(
59                 const c3quat a,
60                 const c3quat b);
61 c3quat
62 c3quat_sub(
63                 const c3quat a,
64                 const c3quat b);
65 c3quat
66 c3quat_minus(
67                 const c3quat a );
68
69 c3quat
70 c3quat_mul(
71                 const c3quat a,
72                 const c3quat b);
73
74 c3mat4
75 c3quat_to_mat4(
76                 const c3quat a );
77
78 c3quatp
79 c3quat_set_angle(
80                 c3quatp a,
81                 c3f f);
82 c3quatp
83 c3quat_scale_angle(
84                 c3quatp a,
85                 c3f f);
86 c3f
87 c3quat_get_angle(
88                 const c3quatp a);
89 c3vec3
90 c3quat_get_axis(
91                 c3quatp a);
92
93 #endif /* __C3QUATERNION_H___ */