$search

rtcMath.h File Reference

#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <rtc/rtcException.h>
#include <rtc/rtcStringTools.h>
Include dependency graph for rtcMath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  rtc

Defines

#define D2R   0.0174532925199432957692
 Conversion factor for degrees to radians.
#define EPS_   1E-5
 Conversion factor for degrees to radians.
#define LN10   2.30258509299404568402
#define LN2   0.693147180559945309417
 Some useful mathematical constants.
#define PI   3.14159265358979323846
#define PI_2   1.57079632679489661923
#define PI_4   0.785398163397448309616
#define R2D   57.295779513082320876
 Conversion factor for radians to degrees.
#define SQRT1_2   0.707106781186547524401
#define SQRT2   1.41421356237309504880
#define TWOPI   6.28318530717958647692

Functions

long long int rtc::rtc_abs (const long long int &x)
long int rtc::rtc_abs (const long int &x)
int rtc::rtc_abs (const int &x)
float rtc::rtc_abs (const float &x)
double rtc::rtc_abs (const double &x)
 Absolute value.
double rtc::rtc_acos (double x)
 Arc cosine.
float rtc::rtc_acos (float x)
 Arc cosine.
double rtc::rtc_asin (double x)
 Arc sine.
float rtc::rtc_asin (float x)
 Arc sine.
double rtc::rtc_atan (double x)
 Arc tangent.
float rtc::rtc_atan (float x)
 Arc tangent.
double rtc::rtc_atan2 (double y, double x)
 Arc tangent of y/x.
float rtc::rtc_atan2 (float y, float x)
 Arc tangent of y/x.
template<class T >
void rtc::rtc_cartesian_to_spherical (const T &x, const T &y, const T &z, T &r, T &theta, T &phi)
 converts cartesian coordinates to spherical coordinates
template<class T >
rtc::rtc_clamp (const T x, const T a, const T b)
 clamp the given variable x to passed range [a,b]
template<class T >
int rtc::rtc_compare (const void *a, const void *b)
 compare floating point numbers (for sorts)
double rtc::rtc_cos (double x)
 Cosinus.
float rtc::rtc_cos (float x)
 Cosinus.
template<class T >
rtc::rtc_cube (const T x)
 cube a number
template<class T >
rtc::rtc_cuberoot (const T x)
 a number^3/2
template<class T >
rtc::rtc_lerp (const T &t0, const T &t1, float a)
template<class T >
rtc::rtc_max (const T x1, const T x2, const T x3)
 return the maximum
template<class T >
rtc::rtc_max (const T x1, const T x2)
 return the maximum
template<class T >
rtc::rtc_min (const T x1, const T x2, const T x3)
 return the minimum
template<class T >
rtc::rtc_min (const T x1, const T x2)
 return the minimum
template<class T >
rtc::rtc_normal_rand (T mean=T(0), T stdev=T(1))
 Returns a sample from a normal distribution.
template<class T >
void rtc::rtc_normalize_spherical (T &theta, T &phi)
 r in [0,inf), theta in [0,2PI), and phi in [0,PI],
template<class T >
rtc::rtc_normalize_theta (T theta)
 normalizes theta to a [-PI,PI] interval
template<class T , class U >
rtc::rtc_pow (const T &x, const U &y)
 x by the power of y
template<>
float rtc::rtc_pow< float, int > (const float &x, const int &y)
 x by the power of y
template<class T >
rtc::rtc_pythag (T a, T b)
 return (a^2 + b^2)^(1/2) without over/underflow
template<class T >
rtc::rtc_quart (const T x)
 take number to the 4th power
template<class T >
rtc::rtc_quint (const T x)
 take number to the 5th power
template<class T >
int rtc::rtc_round (const T x)
 rounds a value to the nearest integer.
template<class T >
rtc::rtc_safe_acos (T costheta)
template<class T >
rtc::rtc_sign (const T x)
 return the sign of a number
double rtc::rtc_sin (double x)
 Sinus.
float rtc::rtc_sin (float x)
 Sinus.
template<class T >
void rtc::rtc_spherical_to_cartesian (const T &r, const T &theta, const T &phi, T &x, T &y, T &z)
 converts spherical coordinates to cartesian coordinates
template<class T >
rtc::rtc_sqr (const T x)
 square a number
template<class T >
rtc::rtc_sqrt (const T &x)
 Square root.
template<class T >
void rtc::rtc_swap (T &x1, T &x2)
 swap values
double rtc::rtc_tan (double x)
 Tangent.
float rtc::rtc_tan (float x)
 Tangent.
template<class T >
int rtc::rtc_trunc (const T x)
 returns the integral digits of the specified number x
template<class T >
rtc::rtc_uniform_rand (T lower=T(0), T upper=T(1))
 Returns a sample from a uniform distribution.
template<class T >
bool rtc::rtc_within (const T x, const T a, const T b)
 returns true if the given variable x is in passed range [a,b]
void rtc::seedRand (void)
 Seed pseudo-random number generator.

Define Documentation

#define D2R   0.0174532925199432957692

Conversion factor for degrees to radians.

Definition at line 40 of file rtcMath.h.

#define EPS_   1E-5

Conversion factor for degrees to radians.

Definition at line 37 of file rtcMath.h.

#define LN10   2.30258509299404568402

Definition at line 47 of file rtcMath.h.

#define LN2   0.693147180559945309417

Some useful mathematical constants.

Definition at line 46 of file rtcMath.h.

#define PI   3.14159265358979323846

Definition at line 48 of file rtcMath.h.

#define PI_2   1.57079632679489661923

Definition at line 50 of file rtcMath.h.

#define PI_4   0.785398163397448309616

Definition at line 51 of file rtcMath.h.

#define R2D   57.295779513082320876

Conversion factor for radians to degrees.

Definition at line 43 of file rtcMath.h.

#define SQRT1_2   0.707106781186547524401

Definition at line 53 of file rtcMath.h.

#define SQRT2   1.41421356237309504880

Definition at line 52 of file rtcMath.h.

#define TWOPI   6.28318530717958647692

Definition at line 49 of file rtcMath.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtc
Author(s): Benjamin Pitzer
autogenerated on Sun Mar 3 11:08:12 2013