/* -*- C++ -*- ------------------------------------------------------------ Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/ The Configurable Math Library (CML) is distributed under the terms of the Boost Software License, v1.0 (see cml/LICENSE for details). *-----------------------------------------------------------------------*/ /** @file * @brief */ #ifndef vector_functions_h #define vector_functions_h namespace cml { /** Squared length of a vector. */ template inline typename vector::value_type length_squared(const vector& arg) { return arg.length_squared(); } /** Squared length of a vector expr. */ template inline typename XprT::value_type length_squared(VECXPR_ARG_TYPE arg) { return arg.length_squared(); } /** Length of a vector. */ template inline typename vector::value_type length(const vector& arg) { return arg.length(); } /** Length of a vector expr. */ template inline typename XprT::value_type length(VECXPR_ARG_TYPE arg) { return arg.length(); } /** Normalize a vector. */ template inline vector normalize(const vector& arg) { vector result(arg); result.normalize(); return result; } /** Normalize a vector expr. */ template inline typename XprT::result_type normalize(VECXPR_ARG_TYPE arg) { return arg.normalize(); } } // namespace cml #endif // ------------------------------------------------------------------------- // vim:ft=cpp