* add the Hklquaternnion documentation
[hkl.git] / hkl / hkl-quaternion.h
blobf984d99c67c4241e1806dcd90441cb72b24d5b83
1 /* This file is part of the hkl library.
3 * The hkl library is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * The hkl library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with the hkl library. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright (C) 2003-2010 Synchrotron SOLEIL
17 * L'Orme des Merisiers Saint-Aubin
18 * BP 48 91192 GIF-sur-YVETTE CEDEX
20 * Authors: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
22 #ifndef __HKL_QUATERNION_H__
23 #define __HKL_QUATERNION_H__
25 #include <stdio.h>
26 #include <math.h>
27 #include <hkl/hkl-macros.h>
28 #include <hkl/hkl-vector.h>
29 #include <hkl/hkl-matrix.h>
31 HKL_BEGIN_DECLS
33 struct _HklQuaternion
35 double data[4];
38 extern void hkl_quaternion_init(HklQuaternion *self,
39 double a, double b, double c, double d);
41 extern void hkl_quaternion_init_from_vector(HklQuaternion *self, const HklVector *v);
43 extern void hkl_quaternion_init_from_angle_and_axe(HklQuaternion *self,
44 double angle, const HklVector *v);
46 extern void hkl_quaternion_fprintf(FILE *file, const HklQuaternion *self);
48 extern int hkl_quaternion_cmp(const HklQuaternion *self, const HklQuaternion *q);
50 extern void hkl_quaternion_minus_quaternion(HklQuaternion *self,
51 const HklQuaternion *q);
53 extern void hkl_quaternion_times_quaternion(HklQuaternion *self,
54 const HklQuaternion *q);
56 extern double hkl_quaternion_norm2(const HklQuaternion *self);
58 extern void hkl_quaternion_conjugate(HklQuaternion *self);
60 extern void hkl_quaternion_to_matrix(const HklQuaternion *self, HklMatrix *m);
62 extern void hkl_quaternion_to_angle_and_axe(const HklQuaternion *self,
63 double *angle, HklVector *v);
65 HKL_END_DECLS
67 #endif