diff options
author | saurabhb17 | 2020-02-26 16:20:48 +0530 |
---|---|---|
committer | GitHub | 2020-02-26 16:20:48 +0530 |
commit | b77f5d9d8097c38159c6f60917995d6af13bbe1c (patch) | |
tree | 1392c90227aeea231c1d86371131e04c40382918 /include/gal/opengl/glm/gtx/norm.inl | |
parent | dadc4d490966a24efe15b5cc533ef8695986048a (diff) | |
parent | 003d02608917e7a69d1a98438837e94ccf68352a (diff) | |
download | KiCad-eSim-b77f5d9d8097c38159c6f60917995d6af13bbe1c.tar.gz KiCad-eSim-b77f5d9d8097c38159c6f60917995d6af13bbe1c.tar.bz2 KiCad-eSim-b77f5d9d8097c38159c6f60917995d6af13bbe1c.zip |
Merge pull request #4 from FOSSEE/develop
merging dev into master
Diffstat (limited to 'include/gal/opengl/glm/gtx/norm.inl')
-rw-r--r-- | include/gal/opengl/glm/gtx/norm.inl | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/include/gal/opengl/glm/gtx/norm.inl b/include/gal/opengl/glm/gtx/norm.inl new file mode 100644 index 0000000..427a5a1 --- /dev/null +++ b/include/gal/opengl/glm/gtx/norm.inl @@ -0,0 +1,156 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-07-24 +// Licence : This source is under MIT License +// File : glm/gtx/norm.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + template <typename T> + GLM_FUNC_QUALIFIER T length2 + ( + T const & x + ) + { + return x * x; + } + + template <typename T> + GLM_FUNC_QUALIFIER T length2 + ( + detail::tvec2<T> const & x + ) + { + return dot(x, x); + } + + template <typename T> + GLM_FUNC_QUALIFIER T length2 + ( + detail::tvec3<T> const & x + ) + { + return dot(x, x); + } + + template <typename T> + GLM_FUNC_QUALIFIER T length2 + ( + detail::tvec4<T> const & x + ) + { + return dot(x, x); + } + + template <typename T> + GLM_FUNC_QUALIFIER T length2 + ( + detail::tquat<T> const & q + ) + { + return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; + } + + template <typename T> + GLM_FUNC_QUALIFIER T distance2 + ( + T const & p0, + T const & p1 + ) + { + return length2(p1 - p0); + } + + template <typename T> + GLM_FUNC_QUALIFIER T distance2 + ( + detail::tvec2<T> const & p0, + detail::tvec2<T> const & p1 + ) + { + return length2(p1 - p0); + } + + template <typename T> + GLM_FUNC_QUALIFIER T distance2 + ( + detail::tvec3<T> const & p0, + detail::tvec3<T> const & p1 + ) + { + return length2(p1 - p0); + } + + template <typename T> + GLM_FUNC_QUALIFIER T distance2 + ( + detail::tvec4<T> const & p0, + detail::tvec4<T> const & p1 + ) + { + return length2(p1 - p0); + } + + template <typename T> + GLM_FUNC_QUALIFIER T l1Norm + ( + detail::tvec3<T> const & a, + detail::tvec3<T> const & b + ) + { + return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z); + } + + template <typename T> + GLM_FUNC_QUALIFIER T l1Norm + ( + detail::tvec3<T> const & v + ) + { + return abs(v.x) + abs(v.y) + abs(v.z); + } + + template <typename T> + GLM_FUNC_QUALIFIER T l2Norm + ( + detail::tvec3<T> const & a, + detail::tvec3<T> const & b + ) + { + return length(b - a); + } + + template <typename T> + GLM_FUNC_QUALIFIER T l2Norm + ( + detail::tvec3<T> const & v + ) + { + return length(v); + } + + template <typename T> + GLM_FUNC_QUALIFIER T lxNorm + ( + detail::tvec3<T> const & x, + detail::tvec3<T> const & y, + unsigned int Depth + ) + { + return pow(pow(y.x - x.x, T(Depth)) + pow(y.y - x.y, T(Depth)) + pow(y.z - x.z, T(Depth)), T(1) / T(Depth)); + } + + template <typename T> + GLM_FUNC_QUALIFIER T lxNorm + ( + detail::tvec3<T> const & v, + unsigned int Depth + ) + { + return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth)); + } + +}//namespace glm |