32 #ifndef SPL_cgalUtil_hpp
33 #define SPL_cgalUtil_hpp
39 #include <SPL/config.hpp>
42 #include <CGAL/Cartesian.h>
43 #include <CGAL/Vector_3.h>
44 #include <CGAL/Point_3.h>
66 inline typename T::FT
norm(
const typename CGAL::Vector_3<T>& v)
79 inline typename T::Vector_3
normalize(
const typename CGAL::Vector_3<T>& v)
81 typename T::FT
norm = sqrt(v * v);
95 const CGAL::Vector_3<T>& v)
97 return acos((u * v) / (
norm(u) *
norm(v)));
189 typename T::FT theta = 0.5 * rot.
angle;
T::Vector_3 normalize(const typename CGAL::Vector_3< T > &v)
Compute a unit vector.
Definition: cgalUtil.hpp:79
A quaternion represented in terms of its scalar and vector parts.
Definition: cgalUtil.hpp:133
T::Vector_3 Vector_3
The 3-dimensional vector type.
Definition: cgalUtil.hpp:112
Definition: Arcball.hpp:48
Rotation_3< T > quaternionToRotation(const Quaternion< T > &q)
Convert a unit-norm quaternion into its corresponding rotation.
Definition: cgalUtil.hpp:198
T::FT norm(const typename CGAL::Vector_3< T > &v)
Compute the norm of a vector.
Definition: cgalUtil.hpp:66
Real angle
The angle of rotation.
Definition: cgalUtil.hpp:124
Real scalar
The scalar part of the quaternion.
Definition: cgalUtil.hpp:153
Quaternion< T > operator*(const Quaternion< T > &q, const Quaternion< T > &r)
Compute the product of two quaternions.
Definition: cgalUtil.hpp:164
A 3-D rotation.
Definition: cgalUtil.hpp:106
Vector_3 vector
The vector part of the quaternion.
Definition: cgalUtil.hpp:156
Quaternion< T > rotationToQuaternion(const Rotation_3< T > &rot)
Convert a rotation into its corresponding quaternion.
Definition: cgalUtil.hpp:187
T::FT Real
The field type for the CGAL kernel.
Definition: cgalUtil.hpp:136
This file contains various mathematical functions/code.
T::FT angleBetweenVectors(const typename CGAL::Vector_3< T > &u, const CGAL::Vector_3< T > &v)
Compute the angle between two vectors.
Definition: cgalUtil.hpp:94
CGAL::Vector_3< T > Vector_3
The 3-dimensional vector type.
Definition: cgalUtil.hpp:139
Quaternion(Real scalar_, const Vector_3 &vector_)
Definition: cgalUtil.hpp:149
T::FT Real
The field type for the CGAL kernel.
Definition: cgalUtil.hpp:109
T sqr(const T &x)
The square function.
Definition: math.hpp:107
Rotation_3(const Vector_3 &axis_, Real angle_)
Create a rotation.
Definition: cgalUtil.hpp:117
Vector_3 axis
The axis of rotation.
Definition: cgalUtil.hpp:121
Quaternion< T > operator/(const Quaternion< T > &q, const Quaternion< T > &r)
Compute the quotient of two quaternions.
Definition: cgalUtil.hpp:176
Quaternion()
Definition: cgalUtil.hpp:144