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__
27 #include <hkl/hkl-macros.h>
28 #include <hkl/hkl-vector.h>
29 #include <hkl/hkl-matrix.h>
38 extern HklQuaternion
*hkl_quaternion_dup(const HklQuaternion
* self
);
40 extern void hkl_quaternion_free(HklQuaternion
*self
);
42 extern void hkl_quaternion_init(HklQuaternion
*self
,
43 double a
, double b
, double c
, double d
);
45 extern void hkl_quaternion_init_from_vector(HklQuaternion
*self
, const HklVector
*v
);
47 extern void hkl_quaternion_init_from_angle_and_axe(HklQuaternion
*self
,
48 double angle
, const HklVector
*v
);
50 extern void hkl_quaternion_fprintf(FILE *file
, const HklQuaternion
*self
);
52 extern int hkl_quaternion_cmp(const HklQuaternion
*self
, const HklQuaternion
*q
);
54 extern void hkl_quaternion_minus_quaternion(HklQuaternion
*self
,
55 const HklQuaternion
*q
);
57 extern void hkl_quaternion_times_quaternion(HklQuaternion
*self
,
58 const HklQuaternion
*q
);
60 extern double hkl_quaternion_norm2(const HklQuaternion
*self
);
62 extern void hkl_quaternion_conjugate(HklQuaternion
*self
);
64 extern void hkl_quaternion_to_matrix(const HklQuaternion
*self
, HklMatrix
*m
);
66 extern void hkl_quaternion_to_angle_and_axe(const HklQuaternion
*self
,
67 double *angle
, HklVector
*v
);