# Math File Reference

`#include <math.h>`

Include dependency graph for Math:

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

## Namespaces

namespace | osg

## Functions

template<typename T>
T | absolute (T v)
| return the minimum of two values, equivalent to std::min.
float | equivalent (float lhs, float rhs, float epsilon=1e-6)
| return true if float lhs and rhs are equivalent, meaning that the difference between them is less than an epsilon value which defaults to 1e-6.
double | equivalent (double lhs, double rhs, double epsilon=1e-6)
| return true if double lhs and rhs are equivalent, meaning that the difference between them is less than an epsilon value which defaults to 1e-6.
template<typename T>
T | minimum (T lhs, T rhs)
| return the minimum of two values, equivilent to std::min.
template<typename T>
T | maximum (T lhs, T rhs)
| return the maximum of two values, equivilent to std::max.
template<typename T>
T | clampTo (T v, T minimum, T maximum)
template<typename T>
T | clampAbove (T v, T minimum)
template<typename T>
T | clampBelow (T v, T maximum)
template<typename T>
T | clampBetween (T v, T minimum, T maximum)
template<typename T>
T | sign (T v)
template<typename T>
T | square (T v)
template<typename T>
T | signedSquare (T v)
float | inDegrees (float angle)
double | inDegrees (double angle)
template<typename T>
T | inRadians (T angle)
float | DegreesToRadians (float angle)
double | DegreesToRadians (double angle)
float | RadiansToDegrees (float angle)
double | RadiansToDegrees (double angle)
bool | isNaN (float v)
bool | isNaN (double v)
template<typename T>
float | computeVolume (const T &a, const T &b, const T &c, const T &d)
| compute the volume of a tetrahedron.
template<typename T>
float | computeVolume (const T &f1, const T &f2, const T &f3, const T &b1, const T &b2, const T &b3)
| compute the volume of a prism.

## Variables

const double | PI = 3.14159265358979323846
const double | PI_2 = 1.57079632679489661923
const double | PI_4 = 0.78539816339744830962

## Function Documentation

template<typename T>
T absolute | ( | T | v | ) | `[inline]`

| return the minimum of two values, equivalent to std::min. std::min not used because of STL implementation under IRIX not containing std::min.

template<typename T>
T clampAbove | ( | T | v,
|  | T | minimum
| ) | `[inline]`

template<typename T>
T clampBelow | ( | T | v,
|  | T | maximum
| ) | `[inline]`

template<typename T>
T clampBetween | ( | T | v,
|  | T | minimum,
|  | T | maximum
| ) | `[inline]`

template<typename T>
T clampTo | ( | T | v,
|  | T | minimum,
|  | T | maximum
| ) | `[inline]`

template<typename T>
float computeVolume | ( | const T & | f1,
|  | const T & | f2,
|  | const T & | f3,
|  | const T & | b1,
|  | const T & | b2,
|  | const T & | b3
| ) | `[inline]`

| compute the volume of a prism.

template<typename T>
float computeVolume | ( | const T & | a,
|  | const T & | b,
|  | const T & | c,
|  | const T & | d
| ) | `[inline]`

| compute the volume of a tetrahedron.

double DegreesToRadians | ( | double | angle | ) | `[inline]`

float DegreesToRadians | ( | float | angle | ) | `[inline]`

double equivalent | ( | double | lhs,
|  | double | rhs,
|  | double | epsilon = `1e-6`
| ) | `[inline]`

| return true if double lhs and rhs are equivalent, meaning that the difference between them is less than an epsilon value which defaults to 1e-6.

float equivalent | ( | float | lhs,
|  | float | rhs,
|  | float | epsilon = `1e-6`
| ) | `[inline]`

| return true if float lhs and rhs are equivalent, meaning that the difference between them is less than an epsilon value which defaults to 1e-6.

double inDegrees | ( | double | angle | ) | `[inline]`

float inDegrees | ( | float | angle | ) | `[inline]`

template<typename T>
T inRadians | ( | T | angle | ) | `[inline]`

bool isNaN | ( | double | v | ) | `[inline]`

bool isNaN | ( | float | v | ) | `[inline]`

template<typename T>
T maximum | ( | T | lhs,
|  | T | rhs
| ) | `[inline]`

| return the maximum of two values, equivilent to std::max. std::max not used because of STL implementation under IRIX not containing std::max.

template<typename T>
T minimum | ( | T | lhs,
|  | T | rhs
| ) | `[inline]`

| return the minimum of two values, equivilent to std::min. std::min not used because of STL implementation under IRIX not containing std::min.

double RadiansToDegrees | ( | double | angle | ) | `[inline]`

float RadiansToDegrees | ( | float | angle | ) | `[inline]`

template<typename T>
T sign | ( | T | v | ) | `[inline]`

template<typename T>
T signedSquare | ( | T | v | ) | `[inline]`

template<typename T>
T square | ( | T | v | ) | `[inline]`

## Variable Documentation

const double osg::PI = 3.14159265358979323846

const double osg::PI_2 = 1.57079632679489661923

const double osg::PI_4 = 0.78539816339744830962