# GLM: fast_square_root.hpp Source File

- Main Page
- Namespaces
- Files

- File List

# fast_square_root.hpp

    00001
    00002 // OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)
    00004 // Created : 2006-01-04
    00005 // Updated : 2008-10-07
    00006 // Licence : This source is under MIT License
    00007 // File    : glm/gtx/fast_square_root.h
    00009 // Dependency:
    00010 // - GLM core
    00012 // Note:
    00013 // - Sqrt optimisation based on Newton's method,
    00014 // www.gamedev.net/community/forums/topic.asp?topic id=139956
    00016
    00017 #ifndef glm_gtx_fast_square_root
    00018 #define glm_gtx_fast_square_root
    00019
    00020 // Dependency:
    00021 #include "../glm.hpp"
    00022
    00023 namespace glm
    00024 {
    00025         namespace test{
    00026                 void main_gtx_fast_square_root();
    00027         }//namespace test
    00028
    00029         namespace gtx{
    00031         namespace fast_square_root
    00032         {
    00035                 template <typename genType>
    00036                 genType fastSqrt(genType const & x);
    00037
    00040                 template <typename genType>
    00041                 genType fastInverseSqrt(genType const & x);
    00042
    00045                 template <typename genType>
    00046                 typename genType::value_type fastLength(genType const & x);
    00047
    00050                 template <typename genType>
    00051                 typename genType::value_type fastDistance(genType const & x, genType const & y);
    00052
    00055                 template <typename genType>
    00056                 genType fastNormalize(genType const & x);
    00057
    00058         }//namespace fast_square_root
    00059         }//     namespace gtx
    00060 }//namespace glm
    00061
    00062 #define GLM_GTX_fast_square_root namespace gtx::fast_square_root
    00063 #ifndef GLM_GTX_GLOBAL
    00064 namespace glm {using GLM_GTX_fast_square_root;}
    00065 #endif//GLM_GTX_GLOBAL
    00066
    00067 #include "fast_square_root.inl"
    00068
    00069 #endif//glm_gtx_fast_square_root