util.h File Reference

#include <algorithm>
#include <cstdlib>
#include <cml/constants.h>

Include dependency graph for util.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  cml

Functions

template<typename T >
cml::acos_safe (T theta)
 Wrap std::acos() and clamp argument to [-1, 1].
template<typename T >
cml::asin_safe (T theta)
 Wrap std::asin() and clamp argument to [-1, 1].
template<typename T >
cml::clamp (T value, T min, T max)
 Clamp input value to the range [min, max].
template<typename T >
cml::cub (T value)
 Cube a value.
void cml::cyclic_permutation (size_t first, size_t &i, size_t &j, size_t &k, size_t &l)
 Cyclic permutation of the set { 0, 1, 2, 3 }, starting with 'first'.
void cml::cyclic_permutation (size_t first, size_t &i, size_t &j, size_t &k)
 Cyclic permutation of the set { 0, 1, 2 }, starting with 'first'.
void cml::cyclic_permutation (size_t first, size_t &i, size_t &j)
 Cyclic permutation of the set { 0, 1 }, starting with 'first'.
template<typename T >
cml::deg (T theta)
 Convert radians to degrees.
template<typename T >
cml::fov_to_zoom (T fov)
 Convert field of view to zoom factor.
template<typename T >
bool cml::in_range (T value, T min, T max)
 Test input value for inclusion in [min, max].
template<typename T >
size_t cml::index_of_max (T a, T b, T c)
 Index of maximum of 3 values.
template<typename T >
size_t cml::index_of_max (T a, T b)
 Index of maximum of 2 values.
template<typename T >
size_t cml::index_of_max_abs (T a, T b, T c)
 Index of maximum of 3 values by magnitude.
template<typename T >
size_t cml::index_of_max_abs (T a, T b)
 Index of maximum of 2 values by magnitude.
template<typename T >
size_t cml::index_of_min (T a, T b, T c)
 Index of minimum of 3 values.
template<typename T >
size_t cml::index_of_min (T a, T b)
 Index of minimum of 2 values.
template<typename T >
size_t cml::index_of_min_abs (T a, T b, T c)
 Index of minimum of 3 values by magnitude.
template<typename T >
size_t cml::index_of_min_abs (T a, T b)
 Index of minimum of 2 values by magnitude.
template<typename T >
cml::inv_sqrt (T value)
 Inverse square root.
template<typename T >
cml::length (T x, T y, T z)
 Length in R3.
template<typename T >
cml::length (T x, T y)
 Length in R2.
template<typename T >
cml::length_squared (T x, T y, T z)
 Squared length in R3.
template<typename T >
cml::length_squared (T x, T y)
 Squared length in R2.
template<typename T >
cml::map_range (T value, T min1, T max1, T min2, T max2)
 Map input value from [min1, max1] to [min2, max2].
size_t cml::next (size_t i, size_t N)
 Return next, with cycling, in a series of N non-negative integers.
size_t cml::prev (size_t i, size_t N)
 Return previous, with cycling, in a series of N non-negative integers.
template<typename T >
cml::rad (T theta)
 Convert degrees to radians.
size_t cml::random_binary ()
 Random binary (0,1) value.
long cml::random_integer (long min, long max)
int cml::random_polar ()
 Random polar (-1,1) value.
template<typename T >
cml::random_real (T min, T max)
double cml::random_unit ()
 Random real in [0,1].
template<typename T >
double cml::sign (T value)
 Sign of input value as double.
template<typename T >
cml::sqr (T value)
 Square a value.
template<typename T >
cml::sqrt_safe (T value)
 Wrap std::sqrt() and clamp argument to [0, inf).
template<typename T >
cml::wrap (T value, T min, T max)
 Wrap input value to the range [min,max].
template<typename T >
cml::xfov_to_yfov (T xfov, T aspect)
 Convert horizontal field of view to vertical field of view.
template<typename T >
cml::xzoom_to_yzoom (T xzoom, T aspect)
 Convert horizontal zoom to vertical zoom.
template<typename T >
cml::yfov_to_xfov (T yfov, T aspect)
 Convert vertical field of view to horizontal field of view.
template<typename T >
cml::yzoom_to_xzoom (T yzoom, T aspect)
 Convert vertical zoom to horizontal zoom.
template<typename T >
cml::zoom_to_fov (T zoom)
 Convert zoom factor to field of view.


Detailed Description

Definition in file util.h.


Generated on Sat Jul 18 19:35:36 2009 for CML 1.0 by  doxygen 1.5.9