18 #ifndef __stir_Quaternion_H__ 19 #define __stir_Quaternion_H__ 25 template <
typename coordT>
26 class Quaternion :
public BasicCoordinate<4, coordT>
29 typedef BasicCoordinate<4, coordT> base_type;
33 Quaternion(
const coordT&,
const coordT&,
const coordT&,
const coordT&);
34 Quaternion(
const base_type& q);
42 inline Quaternion& operator*=(
const coordT& a);
43 inline Quaternion& operator*=(
const Quaternion& q);
44 inline Quaternion operator*(
const Quaternion& q)
const;
45 inline Quaternion operator*(
const coordT& a)
const;
47 inline Quaternion& operator/=(
const coordT& a);
48 inline Quaternion& operator/=(
const Quaternion& q);
49 inline Quaternion operator/(
const Quaternion& q)
const;
50 inline Quaternion operator/(
const coordT& a)
const;
52 inline void neg_quaternion();
53 inline void conjugate();
54 inline void normalise();
55 inline void inverse();
56 inline static coordT dot_product(
const Quaternion&,
const Quaternion&);
61 template <
typename coordT>
62 inline Quaternion<coordT> conjugate(
const Quaternion<coordT>&);
64 template <
typename coordT>
65 inline Quaternion<coordT> inverse(
const Quaternion<coordT>&);
67 template <
typename coordT>
70 template <
typename coordT>
71 inline coordT
norm(
const Quaternion<coordT>& q);
This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate obj...
Implementation of class stir::Quaternion.
double norm_squared(const BasicCoordinate< num_dimensions, coordT > &p1)
compute (inner_product(p1,p1))
Definition: BasicCoordinate.inl:415
double norm(const BasicCoordinate< num_dimensions, coordT > &p1)
compute sqrt(inner_product(p1,p1))
Definition: BasicCoordinate.inl:426