sge::math Namespace Reference


Classes

class  basic_sequence
class  basic_box
class  basic_circle
class  basic_dim
class  basic_matrix
struct  next_pow_2_implementation
struct  sge::math::next_pow_2_implementation< true >
class  basic_rect
class  basic_vector

Namespaces

namespace  detail

Typedefs

typedef basic_box< space_unitspace_box
typedef basic_circle< space_unitcircle
typedef basic_dim< space_unit, 2 > dim2
typedef basic_dim< space_unit, 3 > dim3
typedef basic_matrix
< space_unit, 4, 4 > 
space_matrix
typedef basic_rect< space_unitrect
typedef basic_vector
< space_unit, 2 > 
vector2
typedef basic_vector
< space_unit, 3 > 
vector3
typedef basic_vector
< space_unit, 4 > 
vector4

Functions

template<typename T>
basic_dim< T, 2 > const max_dim ()
template<typename Dest, typename T>
boost::enable_if
< boost::is_floating_point
< Dest >, boost::optional
< Dest > >::type 
angle_to (const basic_vector< T, 2 > &from, const basic_vector< T, 2 > &to)
template<typename Dest, typename T>
boost::enable_if
< boost::is_floating_point
< Dest >, boost::optional
< Dest > >::type 
angle_to (const basic_vector< T, 2 > &to)
SGE_SYMBOL space_unit rel_angle_to_abs (space_unit)
SGE_SYMBOL space_unit abs_angle_to_rel (space_unit)
SGE_SYMBOL bool is_rel_angle (space_unit)
template<typename T>
boost::enable_if
< boost::is_floating_point< T >
, boost::optional< T > >::type 
atan2 (const sge::math::basic_vector< T, 2 > &v)
template<typename T, detail::dim_type Dim, template< typename, detail::dim_type > class Policy>
bool operator== (basic_sequence< T, Dim, Policy > const &, basic_sequence< T, Dim, Policy > const &)
template<typename T, detail::dim_type Dim, template< typename, detail::dim_type > class Policy>
bool operator!= (basic_sequence< T, Dim, Policy > const &, basic_sequence< T, Dim, Policy > const &)
template<typename D, typename S, detail::dim_type Dim, template< typename, detail::dim_type > class Policy>
basic_sequence< D, Dim, Policy > structure_cast (basic_sequence< S, Dim, Policy > const &)
template<typename CharT, typename CharTraits, typename T, detail::dim_type Dim, template< typename, detail::dim_type > class Policy>
std::basic_ostream< CharT,
CharTraits > & 
operator<< (std::basic_ostream< CharT, CharTraits > &, basic_sequence< T, Dim, Policy > const &)
template<typename T>
bool operator== (const basic_box< T > &l, const basic_box< T > &r)
template<typename T>
bool operator!= (const basic_box< T > &l, const basic_box< T > &r)
template<typename T>
bool intersects (basic_circle< T > const &, basic_circle< T > const &)
template<typename T>
clamp (const T &value, const T &vmin, const T &vmax)
template<typename T>
bool nearly_equals (const T &a, const T &b)
template<typename T>
boost::disable_if
< boost::is_floating_point< T >
, bool >::type 
compare (const T &a, const T &b)
template<typename T>
bool almost_zero (const T t)
template<typename T>
bool in_closed_interval (const T &t, const T &l, const T &r)
template<typename T>
pi ()
template<typename T>
twopi ()
template<typename T>
deg_to_rad (const T deg)
template<typename T>
rad_to_deg (const T rad)
template<typename T>
bool contains (const basic_rect< T > &r, const basic_vector< T, 2 > &p)
template<typename T>
bool contains (const basic_rect< T > &outer, const basic_rect< T > &inner)
template<typename T>
bool intersects (const basic_rect< T > &l, const basic_rect< T > &r)
template<typename T>
bool intersects (const basic_rect< T > &r, const basic_line_seg2< T > &l)
template<typename T>
sge::math::basic_rect< T > const intersection (basic_rect< T > const &r1, basic_rect< T > const &r2)
template<typename T, typename U>
sge::math::basic_rect< T > const bounding (U it, U const end)
template<typename T>
boost::disable_if
< boost::is_unsigned< T >, T >
::type 
diff (T const &a, T const &b)
template<typename T, std::size_t Dim>
basic_dim< T, Dim > operator+ (basic_dim< T, Dim > l, const basic_dim< T, Dim > &r)
template<typename T, std::size_t Dim>
basic_dim< T, Dim > operator- (basic_dim< T, Dim > l, const basic_dim< T, Dim > &r)
template<typename T, std::size_t Dim>
basic_dim< T, Dim > operator* (basic_dim< T, Dim > l, const basic_dim< T, Dim > &r)
template<typename T, std::size_t Dim>
basic_dim< T, Dim > operator/ (basic_dim< T, Dim > l, const basic_dim< T, Dim > &r)
template<typename T, std::size_t Dim, typename Ch, typename Traits>
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &stream, const basic_dim< T, Dim > &v)
template<typename T, std::size_t Dim, typename Ch, typename Traits>
std::basic_istream< Ch, Traits > & operator>> (std::basic_istream< Ch, Traits > &s, basic_dim< T, Dim > &v)
template<typename D, typename S, std::size_t Dim>
basic_dim< D, Dim > structure_cast (const basic_dim< S, Dim > &r)
template<typename T>
boost::enable_if
< boost::is_unsigned< T >, T >
::type 
log2 (const T x)
template<typename T, std::size_t N, std::size_t M>
basic_matrix< T, N, M > operator+ (const basic_matrix< T, N, M > &r)
template<typename T, std::size_t N, std::size_t M>
basic_matrix< T, N, M > operator- (const basic_matrix< T, N, M > &r)
template<typename T, std::size_t N, std::size_t M>
basic_matrix< T, N, M > operator+ (const basic_matrix< T, N, M > &l, const basic_matrix< T, N, M > &r)
template<typename T, std::size_t N, std::size_t M>
basic_matrix< T, N, M > operator- (const basic_matrix< T, N, M > &l, const basic_matrix< T, N, M > &r)
template<typename T, std::size_t N, std::size_t M>
basic_matrix< T, N, M > operator* (const typename basic_matrix< T, N, M >::value_type &l, const basic_matrix< T, N, M > &r)
template<typename T, std::size_t N, std::size_t M1, std::size_t M2>
basic_matrix< T, N, N > operator* (const basic_matrix< T, M1, N > &a, const basic_matrix< T, N, M2 > &b)
template<typename T, std::size_t N, std::size_t M>
bool operator== (const basic_matrix< T, N, M > &l, const basic_matrix< T, N, M > &r)
template<typename T, std::size_t N, std::size_t M>
bool operator!= (const basic_matrix< T, N, M > &l, const basic_matrix< T, N, M > &r)
template<typename T, std::size_t N, std::size_t M, typename Ch, typename Traits>
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &s, const basic_matrix< T, N, M > &m)
template<typename T, std::size_t N>
basic_matrix< T, N, N > transpose (const basic_matrix< T, N, N > &m)
template<typename T, std::size_t N, std::size_t M>
basic_vector< T, M > operator* (const basic_matrix< T, N, M > &m, const basic_vector< T, N > &v)
SGE_SYMBOL space_matrix matrix_translation (const math::basic_vector< space_unit, 3 > &v)
SGE_SYMBOL space_matrix matrix_translation (space_unit x, space_unit y, space_unit z)
SGE_SYMBOL space_matrix matrix_scaling (const math::basic_vector< space_unit, 3 > &v)
SGE_SYMBOL space_matrix matrix_scaling (space_unit x, space_unit y, space_unit z)
SGE_SYMBOL space_matrix matrix_perspective (space_unit aspect, space_unit fov, space_unit near, space_unit far)
SGE_SYMBOL space_matrix matrix_orthogonal_xy ()
SGE_SYMBOL basic_matrix
< space_unit, 2, 2 > 
matrix_rotation_2d (space_unit angle)
SGE_SYMBOL space_matrix matrix_rotation_z (space_unit angle)
SGE_SYMBOL space_matrix matrix_rotation_y (space_unit angle)
SGE_SYMBOL space_matrix matrix_rotation_x (space_unit angle)
SGE_SYMBOL space_matrix matrix_identity ()
SGE_SYMBOL space_matrix matrix_orthogonal_xy (space_unit left, space_unit right, space_unit top, space_unit bottom, space_unit near, space_unit far)
template<typename T>
boost::enable_if
< boost::is_floating_point< T >
, void >::type 
mod_assign (T &l, const T &r)
template<typename T>
boost::enable_if
< boost::is_floating_point< T >
, T >::type 
mod (const T &a, const T &b)
SGE_SYMBOL vector2 const point_rotate (vector2 const &point, vector2 const &around, space_unit rot)
template<typename Base, typename Exp>
Base pow_int (const Base base, const Exp e)
template<typename T>
next_pow_2 (const T t)
template<typename T>
basic_dim< T, 2 > next_pow_2 (const basic_dim< T, 2 > &r)
template<typename T>
boost::enable_if
< boost::is_unsigned< T >
, bool >::type 
is_power_of_2 (const T t)
template<typename T>
boost::enable_if
< boost::is_unsigned< T >
, bool >::type 
is_power_of_2 (const basic_dim< T, 2 > &d)
template<typename T>
quad (T const &t)
template<typename T>
basic_rect< T > const operator+ (const basic_rect< T > &l, const typename basic_rect< T >::point_type &r)
template<typename T>
basic_rect< T > const operator- (const basic_rect< T > &l, const typename basic_rect< T >::point_type &r)
template<typename T>
bool operator== (const basic_rect< T > &l, const basic_rect< T > &r)
template<typename T>
bool operator!= (const basic_rect< T > &l, const basic_rect< T > &r)
template<typename T>
basic_rect< T > const resize_borders (const basic_rect< T > &r, const T diff)
template<typename T, typename Ch, typename Traits>
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &s, const basic_rect< T > &r)
template<typename D, typename S>
basic_rect< D > const structure_cast (const basic_rect< S > &r)
template<typename T>
boost::enable_if
< boost::is_integral< T >, T >
::type 
round_div_int (const T l, const T r)
template<typename T>
boost::disable_if
< boost::is_unsigned< T >, T >
::type 
signum (const T t)
template<typename T, std::size_t Dim>
basic_vector< T, Dim > operator+ (basic_vector< T, Dim > l, const basic_dim< T, Dim > &r)
template<typename T, std::size_t Dim>
basic_vector< T, Dim > operator- (basic_vector< T, Dim > l, const basic_dim< T, Dim > &r)
template<typename T, std::size_t Dim>
basic_vector< T, Dim > operator* (basic_vector< T, Dim > l, const basic_dim< T, Dim > &r)
template<typename T, std::size_t Dim>
basic_vector< T, Dim > operator/ (basic_vector< T, Dim > l, const basic_dim< T, Dim > &r)
template<typename T, std::size_t Dim>
void place (basic_vector< T, Dim > &v, const typename basic_vector< T, Dim >::const_reference radius, const typename basic_vector< T, Dim >::const_reference high_angle, const typename basic_vector< T, Dim >::const_reference plane_angle, typename boost::enable_if_c< Dim==3, T >::type *=0)
template<typename T, std::size_t Dim>
void swap (basic_vector< T, Dim > &a, basic_vector< T, Dim > &b)
template<typename T, std::size_t Dim>
basic_vector< T, Dim > cross (const basic_vector< T, Dim > &l, const basic_vector< T, Dim > &r)
template<typename T, std::size_t Dim>
basic_vector< T, Dim > normalize (basic_vector< T, Dim > l)
template<typename T, std::size_t Dim>
basic_vector< T, Dim >::value_type dot (const basic_vector< T, Dim > &l, const basic_vector< T, Dim > &r)
template<typename T, std::size_t Dim, typename Ch, typename Traits>
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &s, const basic_vector< T, Dim > &v)
template<typename T, std::size_t Dim, typename Ch, typename Traits>
std::basic_istream< Ch, Traits > & operator>> (std::basic_istream< Ch, Traits > &s, basic_vector< T, Dim > &v)
template<typename D, typename S, std::size_t Dim>
basic_vector< D, Dim > structure_cast (const basic_vector< S, Dim > &s)

Variables

const double PI = M_PI
const long double PI_L
const double DEGREE
const long double DEGREE_L


Typedef Documentation


Function Documentation

sge::space_unit sge::math::abs_angle_to_rel ( space_unit  a  ) 

Does the inverse of rel_angle_to_abs

template<typename T>
bool sge::math::almost_zero ( const T  t  )  [inline]

Applies sge::math::compare to t and 0

template<typename Dest, typename T>
boost::enable_if< boost::is_floating_point<Dest>, boost::optional<Dest> >::type sge::math::angle_to ( const basic_vector< T, 2 > &  to  )  [inline]

Calculates the angle between the origin and the given vector using sge::math::atan2.

template<typename Dest, typename T>
boost::enable_if< boost::is_floating_point<Dest>, boost::optional<Dest> >::type sge::math::angle_to ( const basic_vector< T, 2 > &  from,
const basic_vector< T, 2 > &  to 
) [inline]

Calculates the angle between the two vectors using std::atan2

template<typename T>
boost::enable_if< boost::is_floating_point<T>, boost::optional<T> >::type sge::math::atan2 ( const sge::math::basic_vector< T, 2 > &  v  )  [inline]

Wraps std::atan2 so it can be used with sge::math::basic_vector. Returns an empty boost::optional if given the null vector

template<typename T, typename U>
basic_rect< T > const sge::math::bounding ( it,
U const   end 
) [inline]

template<typename T>
T sge::math::clamp ( const T &  value,
const T &  vmin,
const T &  vmax 
) [inline]

Clamps value to the range $[\textrm{vmin},\textrm{vmax}]$

template<typename T>
boost::enable_if< boost::is_floating_point< T >, bool >::type sge::math::compare ( const T &  a,
const T &  b 
) [inline]

This is the non floating point version of compare which simply uses operator==

The floating point version of compare uses sge::math::nearly_equals

template<typename T>
bool sge::math::contains ( const basic_rect< T > &  outer,
const basic_rect< T > &  inner 
) [inline]

template<typename T>
bool sge::math::contains ( const basic_rect< T > &  r,
const basic_vector< T, 2 > &  p 
) [inline]

template<typename T, std::size_t Dim>
basic_vector<T,Dim> sge::math::cross ( const basic_vector< T, Dim > &  l,
const basic_vector< T, Dim > &  r 
) [inline]

template<typename T>
T sge::math::deg_to_rad ( const T  deg  )  [inline]

template<typename T>
boost::enable_if< boost::is_unsigned< T >, T >::type sge::math::diff ( T const &  a,
T const &  b 
) [inline]

template<typename T, std::size_t Dim>
basic_vector<T,Dim>::value_type sge::math::dot ( const basic_vector< T, Dim > &  l,
const basic_vector< T, Dim > &  r 
) [inline]

template<typename T>
bool sge::math::in_closed_interval ( const T &  t,
const T &  l,
const T &  r 
) [inline]

Checks if t is in $[l,r]$

template<typename T>
basic_rect< T > const sge::math::intersection ( basic_rect< T > const &  r1,
basic_rect< T > const &  r2 
) [inline]

template<typename T>
bool sge::math::intersects ( const basic_rect< T > &  r,
const basic_line_seg2< T > &  l 
) [inline]

template<typename T>
bool sge::math::intersects ( const basic_rect< T > &  l,
const basic_rect< T > &  r 
) [inline]

template<typename T>
bool sge::math::intersects ( basic_circle< T > const &  a,
basic_circle< T > const &  b 
) [inline]

template<typename T>
boost::enable_if<boost::is_unsigned<T>, bool>::type sge::math::is_power_of_2 ( const basic_dim< T, 2 > &  d  )  [inline]

Checks if both coordinates of an unsigned sge::math::basic_dim are powers of two

template<typename T>
boost::enable_if<boost::is_unsigned<T>, bool>::type sge::math::is_power_of_2 ( const T  t  )  [inline]

Checks if an unsigned type is a power of two

bool sge::math::is_rel_angle ( space_unit  a  ) 

template<typename T>
boost::enable_if<boost::is_unsigned<T>, T>::type sge::math::log2 ( const T  x  )  [inline]

Calculates $\log_2(x)$ for unsigned types (using a loop)

sge::math::space_matrix sge::math::matrix_identity (  ) 

sge::math::space_matrix sge::math::matrix_orthogonal_xy ( space_unit  left,
space_unit  right,
space_unit  top,
space_unit  bottom,
space_unit  near,
space_unit  far 
)

sge::math::space_matrix sge::math::matrix_orthogonal_xy (  ) 

sge::math::space_matrix sge::math::matrix_perspective ( space_unit  aspect,
space_unit  fov,
space_unit  near,
space_unit  far 
)

sge::math::basic_matrix< sge::space_unit, 2, 2 > sge::math::matrix_rotation_2d ( space_unit  angle  ) 

sge::math::space_matrix sge::math::matrix_rotation_x ( space_unit  angle  ) 

sge::math::space_matrix sge::math::matrix_rotation_y ( space_unit  angle  ) 

sge::math::space_matrix sge::math::matrix_rotation_z ( space_unit  angle  ) 

sge::math::space_matrix sge::math::matrix_scaling ( space_unit  x,
space_unit  y,
space_unit  z 
)

sge::math::space_matrix sge::math::matrix_scaling ( const math::basic_vector< space_unit, 3 > &  v  ) 

sge::math::space_matrix sge::math::matrix_translation ( space_unit  x,
space_unit  y,
space_unit  z 
)

sge::math::space_matrix sge::math::matrix_translation ( const math::basic_vector< space_unit, 3 > &  v  ) 

template<typename T>
basic_dim<T,2> const sge::math::max_dim (  )  [inline]

template<typename T>
boost::enable_if< boost::is_unsigned< T >, T >::type sge::math::mod ( const T &  a,
const T &  b 
) [inline]

template<typename T>
boost::enable_if< boost::is_unsigned< T >, void >::type sge::math::mod_assign ( T &  l,
const T &  r 
) [inline]

template<typename T>
bool sge::math::nearly_equals ( const T &  a,
const T &  b 
) [inline]

Uses std::numeric_limits<T>::epsilon to check if a is nearly equal to b.

template<typename T>
basic_dim<T, 2> sge::math::next_pow_2 ( const basic_dim< T, 2 > &  r  )  [inline]

"Rounds up" both components of r to the next power of two

template<typename T>
T sge::math::next_pow_2 ( const T  t  )  [inline]

"Rounds up" t to the next power of 2

template<typename T, std::size_t Dim>
basic_vector<T,Dim> sge::math::normalize ( basic_vector< T, Dim >  l  )  [inline]

template<typename T>
bool sge::math::operator!= ( const basic_rect< T > &  l,
const basic_rect< T > &  r 
) [inline]

Uses sge::math::compare to compare the components

template<typename T, std::size_t N, std::size_t M>
bool sge::math::operator!= ( const basic_matrix< T, N, M > &  l,
const basic_matrix< T, N, M > &  r 
) [inline]

template<typename T>
bool sge::math::operator!= ( const basic_box< T > &  l,
const basic_box< T > &  r 
) [inline]

template<typename T, detail::dim_type Dim, template< typename, detail::dim_type > class Policy>
bool sge::math::operator!= ( basic_sequence< T, Dim, Policy > const &  a,
basic_sequence< T, Dim, Policy > const &  b 
) [inline]

template<typename T, std::size_t Dim>
basic_vector<T, Dim> sge::math::operator* ( basic_vector< T, Dim >  l,
const basic_dim< T, Dim > &  r 
) [inline]

template<typename T, std::size_t N, std::size_t M>
sge::math::basic_vector< T, M > sge::math::operator* ( const basic_matrix< T, N, M > &  m,
const basic_vector< T, N > &  v 
) [inline]

template<typename T, std::size_t N, std::size_t M1, std::size_t M2>
sge::math::basic_matrix< T, N, N > sge::math::operator* ( const basic_matrix< T, M1, N > &  a,
const basic_matrix< T, N, M2 > &  b 
) [inline]

template<typename T, std::size_t N, std::size_t M>
sge::math::basic_matrix< T, N, M > sge::math::operator* ( const typename basic_matrix< T, N, M >::value_type &  l,
const basic_matrix< T, N, M > &  r 
) [inline]

template<typename T, std::size_t Dim>
basic_dim<T, Dim> sge::math::operator* ( basic_dim< T, Dim >  l,
const basic_dim< T, Dim > &  r 
) [inline]

template<typename T, std::size_t Dim>
basic_vector<T, Dim> sge::math::operator+ ( basic_vector< T, Dim >  l,
const basic_dim< T, Dim > &  r 
) [inline]

template<typename T>
sge::math::basic_rect< T > const sge::math::operator+ ( const basic_rect< T > &  l,
const typename basic_rect< T >::point_type &  r 
) [inline]

template<typename T, std::size_t N, std::size_t M>
sge::math::basic_matrix< T, N, M > sge::math::operator+ ( const basic_matrix< T, N, M > &  l,
const basic_matrix< T, N, M > &  r 
) [inline]

template<typename T, std::size_t N, std::size_t M>
sge::math::basic_matrix< T, N, M > sge::math::operator+ ( const basic_matrix< T, N, M > &  r  )  [inline]

template<typename T, std::size_t Dim>
basic_dim<T,Dim> sge::math::operator+ ( basic_dim< T, Dim >  l,
const basic_dim< T, Dim > &  r 
) [inline]

template<typename T, std::size_t Dim>
basic_vector<T, Dim> sge::math::operator- ( basic_vector< T, Dim >  l,
const basic_dim< T, Dim > &  r 
) [inline]

template<typename T>
sge::math::basic_rect< T > const sge::math::operator- ( const basic_rect< T > &  l,
const typename basic_rect< T >::point_type &  r 
) [inline]

template<typename T, std::size_t N, std::size_t M>
sge::math::basic_matrix< T, N, M > sge::math::operator- ( const basic_matrix< T, N, M > &  l,
const basic_matrix< T, N, M > &  r 
) [inline]

template<typename T, std::size_t N, std::size_t M>
sge::math::basic_matrix< T, N, M > sge::math::operator- ( const basic_matrix< T, N, M > &  r  )  [inline]

template<typename T, std::size_t Dim>
basic_dim<T,Dim> sge::math::operator- ( basic_dim< T, Dim >  l,
const basic_dim< T, Dim > &  r 
) [inline]

template<typename T, std::size_t Dim>
basic_vector<T, Dim> sge::math::operator/ ( basic_vector< T, Dim >  l,
const basic_dim< T, Dim > &  r 
) [inline]

template<typename T, std::size_t Dim>
basic_dim<T, Dim> sge::math::operator/ ( basic_dim< T, Dim >  l,
const basic_dim< T, Dim > &  r 
) [inline]

template<typename T, std::size_t Dim, typename Ch, typename Traits>
std::basic_ostream<Ch,Traits>& sge::math::operator<< ( std::basic_ostream< Ch, Traits > &  s,
const basic_vector< T, Dim > &  v 
) [inline]

Outputs the vector in the format $(v_0,\ldots,v_n)$.

template<typename T, typename Ch, typename Traits>
std::basic_ostream< Ch, Traits > & sge::math::operator<< ( std::basic_ostream< Ch, Traits > &  s,
const basic_rect< T > &  r 
) [inline]

template<typename T, std::size_t N, std::size_t M, typename Ch, typename Traits>
std::basic_ostream< Ch, Traits > & sge::math::operator<< ( std::basic_ostream< Ch, Traits > &  s,
const basic_matrix< T, N, M > &  m 
) [inline]

template<typename T, std::size_t Dim, typename Ch, typename Traits>
std::basic_ostream<Ch,Traits>& sge::math::operator<< ( std::basic_ostream< Ch, Traits > &  stream,
const basic_dim< T, Dim > &  v 
) [inline]

Outputs the dim in the format $(v_0,\ldots,v_n)$.

template<typename CharT, typename CharTraits, typename T, detail::dim_type Dim, template< typename, detail::dim_type > class Policy>
std::basic_ostream< CharT, CharTraits > & sge::math::operator<< ( std::basic_ostream< CharT, CharTraits > &  s,
basic_sequence< T, Dim, Policy > const &  a 
) [inline]

template<typename T>
bool sge::math::operator== ( const basic_rect< T > &  l,
const basic_rect< T > &  r 
) [inline]

Uses sge::math::compare to compare the components

template<typename T, std::size_t N, std::size_t M>
bool sge::math::operator== ( const basic_matrix< T, N, M > &  l,
const basic_matrix< T, N, M > &  r 
) [inline]

template<typename T>
bool sge::math::operator== ( const basic_box< T > &  l,
const basic_box< T > &  r 
) [inline]

template<typename T, detail::dim_type Dim, template< typename, detail::dim_type > class Policy>
bool sge::math::operator== ( basic_sequence< T, Dim, Policy > const &  a,
basic_sequence< T, Dim, Policy > const &  b 
) [inline]

template<typename T, std::size_t Dim, typename Ch, typename Traits>
std::basic_istream<Ch,Traits>& sge::math::operator>> ( std::basic_istream< Ch, Traits > &  s,
basic_vector< T, Dim > &  v 
) [inline]

Reads the vector from the stream in the format $(v_0,\ldots,v_n)$.

template<typename T, std::size_t Dim, typename Ch, typename Traits>
std::basic_istream<Ch,Traits>& sge::math::operator>> ( std::basic_istream< Ch, Traits > &  s,
basic_dim< T, Dim > &  v 
) [inline]

Reads the vector from the stream in the format $(v_0,\ldots,v_n)$.

template<typename T>
T sge::math::pi (  )  [inline]

template<typename T, std::size_t Dim>
void sge::math::place ( basic_vector< T, Dim > &  v,
const typename basic_vector< T, Dim >::const_reference  radius,
const typename basic_vector< T, Dim >::const_reference  high_angle,
const typename basic_vector< T, Dim >::const_reference  plane_angle,
typename boost::enable_if_c< Dim==3, T >::type *  = 0 
) [inline]

sge::math::vector2 const sge::math::point_rotate ( vector2 const &  point,
vector2 const &  around,
space_unit  rot 
)

Rotates a point around another point at angle rot

template<typename Base, typename Exp>
Base sge::math::pow_int ( const Base  base,
const Exp  e 
) [inline]

Calculates $\textrm{base}^e$ using integer arithmetics (no cast to float and std::pow needed)

template<typename T>
T sge::math::quad ( T const &  t  )  [inline]

Returns the square of (this is pretty dumb)

template<typename T>
T sge::math::rad_to_deg ( const T  rad  )  [inline]

sge::space_unit sge::math::rel_angle_to_abs ( space_unit  a  ) 

Calculates an angle in the range $[-\pi,\pi]$ to an absolute angle in $[0,2 \pi]$

template<typename T>
sge::math::basic_rect< T > const sge::math::resize_borders ( const basic_rect< T > &  r,
const T  diff 
) [inline]

Resizes the rect and adds a border of diff at each side

template<typename T>
boost::enable_if<boost::is_integral<T>, T>::type sge::math::round_div_int ( const T  l,
const T  r 
) [inline]

template<typename T>
boost::disable_if<boost::is_unsigned<T>,T>::type sge::math::signum ( const T  t  )  [inline]

template<typename D, typename S, std::size_t Dim>
basic_vector<D, Dim> sge::math::structure_cast ( const basic_vector< S, Dim > &  s  )  [inline]

Casts the basic_vector<T> to basic_vector<D> (using static_cast).

template<typename D, typename S>
sge::math::basic_rect< D > const sge::math::structure_cast ( const basic_rect< S > &  r  )  [inline]

Casts a sge::math::basic_rect<T> to sge::math::basic_rect<S> using static_cast

template<typename D, typename S, std::size_t Dim>
basic_dim<D, Dim> sge::math::structure_cast ( const basic_dim< S, Dim > &  r  )  [inline]

Casts the basic_dim<T> to basic_dim<D> (using static_cast).

template<typename D, typename S, detail::dim_type Dim, template< typename, detail::dim_type > class Policy>
sge::math::basic_sequence< D, Dim, Policy > sge::math::structure_cast ( basic_sequence< S, Dim, Policy > const &  s  )  [inline]

template<typename T, std::size_t Dim>
void sge::math::swap ( basic_vector< T, Dim > &  a,
basic_vector< T, Dim > &  b 
) [inline]

template<typename T, std::size_t N>
sge::math::basic_matrix< T, N, N > sge::math::transpose ( const basic_matrix< T, N, N > &  m  )  [inline]

template<typename T>
T sge::math::twopi (  )  [inline]


Variable Documentation

const double sge::math::DEGREE

Initial value:

    0.0174532925199432957692369076848861271344287188854172

const long double sge::math::DEGREE_L

Initial value:

    0.0174532925199432957692369076848861271344287188854172L

const double sge::math::PI = M_PI

const long double sge::math::PI_L

Initial value:

    3.1415926535897932384626433832795028841971693993751058L


Generated on Wed Sep 10 22:17:53 2008 for sge by  doxygen 1.5.5