Make quaternions.h compile at work (+ ATOL constant macro).

Why the hell did it compile at home, but fails at work?


Former-commit-id: 5237d9ffda0a2ad3defd22f74dd4ccc3005d7952
This commit is contained in:
Marek Nečada 2019-07-24 11:00:11 +03:00
parent e048a78055
commit d97945a43e
1 changed files with 10 additions and 8 deletions

View File

@ -8,6 +8,8 @@
#include "vectors.h" #include "vectors.h"
#include "tiny_inlines.h" #include "tiny_inlines.h"
/// Just some arbitrarily chosen "default" value for quaternion comparison tolerance.
#define QPMS_QUAT_ATOL (1e-10)
/// Conversion from the 4*double to the 2*complex quaternion. /// Conversion from the 4*double to the 2*complex quaternion.
// TODO is this really correct? // TODO is this really correct?
@ -226,21 +228,21 @@ static inline cart3_t qpms_irot3_apply_cart3(const qpms_irot3_t p, const cart3_t
// Some basic transformations with irot3 type // Some basic transformations with irot3 type
/// Identity /// Identity
static const qpms_irot3_t QPMS_IROT3_IDENTITY = {QPMS_QUAT_1, 1}; static const qpms_irot3_t QPMS_IROT3_IDENTITY = {{1, 0}, 1};
/// \f$ \pi \f$ rotation around x axis. /// \f$ \pi \f$ rotation around x axis.
static const qpms_irot3_t QPMS_IROT3_XROT_PI = {QPMS_QUAT_I, 1}; static const qpms_irot3_t QPMS_IROT3_XROT_PI = {{0, I}, 1};
/// \f$ \pi \f$ rotation around y axis. /// \f$ \pi \f$ rotation around y axis.
static const qpms_irot3_t QPMS_IROT3_YROT_PI = {QPMS_QUAT_J, 1}; static const qpms_irot3_t QPMS_IROT3_YROT_PI = {{0, 1}, 1};
/// \f$ \pi \f$ rotation around z axis. /// \f$ \pi \f$ rotation around z axis.
static const qpms_irot3_t QPMS_IROT3_ZROT_PI = {QPMS_QUAT_K, 1}; static const qpms_irot3_t QPMS_IROT3_ZROT_PI = {{I, 0}, 1};
/// Spatial inversion. /// Spatial inversion.
static const qpms_irot3_t QPMS_IROT3_INVERSION = {QPMS_QUAT_1, -1}; static const qpms_irot3_t QPMS_IROT3_INVERSION = {{1, 0}, -1};
/// yz-plane mirror symmetry /// yz-plane mirror symmetry
static const qpms_irot3_t QPMS_IROT3_XFLIP = {QPMS_QUAT_I, -1}; static const qpms_irot3_t QPMS_IROT3_XFLIP = {{0, I}, -1};
/// xz-plane mirror symmetry /// xz-plane mirror symmetry
static const qpms_irot3_t QPMS_IROT3_YFLIP = {QPMS_QUAT_J, -1}; static const qpms_irot3_t QPMS_IROT3_YFLIP = {{0, 1}, -1};
/// xy-plane mirror symmetry /// xy-plane mirror symmetry
static const qpms_irot3_t QPMS_IROT3_ZFLIP = {QPMS_QUAT_K, -1}; static const qpms_irot3_t QPMS_IROT3_ZFLIP = {{I, 0}, -1};
/// versor representing rotation around z-axis. /// versor representing rotation around z-axis.
static inline qpms_quat_t qpms_quat_zrot_angle(double angle) { static inline qpms_quat_t qpms_quat_zrot_angle(double angle) {