GLM  0.9.5
norm.hpp
Go to the documentation of this file.
1 
39 #ifndef GLM_GTX_norm
40 #define GLM_GTX_norm
41 
42 // Dependency:
43 #include "../glm.hpp"
44 #include "../gtx/quaternion.hpp"
45 
46 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
47 # pragma message("GLM: GLM_GTX_norm extension included")
48 #endif
49 
50 namespace glm
51 {
54 
57  template <typename T>
58  T length2(
59  T const & x);
60 
63  template <typename genType>
64  typename genType::value_type length2(
65  genType const & x);
66 
69  template <typename T>
70  T distance2(
71  T const & p0,
72  T const & p1);
73 
76  template <typename genType>
77  typename genType::value_type distance2(
78  genType const & p0,
79  genType const & p1);
80 
83  template <typename T, precision P>
84  T l1Norm(
85  detail::tvec3<T, P> const & x,
86  detail::tvec3<T, P> const & y);
87 
90  template <typename T, precision P>
91  T l1Norm(
92  detail::tvec3<T, P> const & v);
93 
96  template <typename T, precision P>
97  T l2Norm(
98  detail::tvec3<T, P> const & x,
99  detail::tvec3<T, P> const & y);
100 
103  template <typename T, precision P>
104  T l2Norm(
105  detail::tvec3<T, P> const & x);
106 
109  template <typename T, precision P>
110  T lxNorm(
111  detail::tvec3<T, P> const & x,
112  detail::tvec3<T, P> const & y,
113  unsigned int Depth);
114 
117  template <typename T, precision P>
118  T lxNorm(
119  detail::tvec3<T, P> const & x,
120  unsigned int Depth);
121 
123 }//namespace glm
124 
125 #include "norm.inl"
126 
127 #endif//GLM_GTX_norm
T distance2(T const &p0, T const &p1)
Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
T l1Norm(detail::tvec3< T, P > const &x, detail::tvec3< T, P > const &y)
Returns the L1 norm between x and y.
T l2Norm(detail::tvec3< T, P > const &x, detail::tvec3< T, P > const &y)
Returns the L2 norm between x and y.
T length2(T const &x)
Returns the squared length of x.
T lxNorm(detail::tvec3< T, P > const &x, detail::tvec3< T, P > const &y, unsigned int Depth)
Returns the L norm between x and y.