/home/fayn/OpenKraken-dev/OpenKN-math/src/MathTools.hpp File Reference

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

Go to the source code of this file.

Namespaces

namespace  kn

Functions

static double kn::degToRad (const double &deg)
 Convert degrees to radians.
static double kn::radToDeg (const double &rad)
 Convert radians to degrees.
static double kn::pythag (const double &a, const double &b)
 Computes (a^2 + b^2)^1/2 without destructive underflow or overflow Algorithm from Numerical Recipes Second Edition (1992).
template<class T >
static T kn::setSign (const T &a, const T &b)
 set a with the same sign than b
template<class T >
static T kn::getSign (const T &a)
 Return the sign of a.
static bool kn::isPowerOfTwo (const unsigned int &n)
 check if n is a power of two or not
static unsigned int kn::ceilPowerOfTwo (const unsigned int &n)
 Return the highest power of two value close to n.
static unsigned int kn::floorPowerOfTwo (const unsigned int &n)
 Return the lowest power of two value close to n.

Variables

static const double kn::PI = 3.14159265358979323846
 PI.
static const double kn::TWO_PI = 6.28318530717958647692
 2*PI
static const double kn::PI_TWO = 1.57079632679489661923
 PI/2.
static const double kn::PI_FOUR = 0.78539816339744830962
 PI/4.
static const double kn::DEG2RAD = 0.01745329251994329576
 Convertion factor from degrees to radians.
static const double kn::RAD2DEG = 57.2957795130823208767
 Convertion factor from radians to degrees.
static const double kn::GOLDEN_NUMBER = 1.61803398874989484820
 The golden number (1+sqrt(5))/2.


Generated on Thu Nov 12 16:06:35 2009 for OpenKN-math by  doxygen 1.5.8