Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvmath Namespace Reference

Namespace for mathematical helper functions and classes. More...


Compounds

class  BoundingSphere
 Sphere class that represents the bounding sphere of a set of points. More...

class  Mat33f
 3x3 matrix class. More...

class  Mat44f
 4x4 matrix class. More...

class  Matnnf
 Template for nxn-matrices. More...

class  Plane3f
 Plane class. More...

class  Quatf
 Quaternion class. More...

class  Sphere3f
 Sphere class. More...

class  Trafo
 transformation class. More...

class  Vec2f
 2-component vector class. More...

class  Vec3f
 3-component vector class. More...

class  Vec4f
 4-component vector class. More...

class  Vecnf
 Template for n-dimensional vector. More...


Functions

template<class T> T clamp (T v, T l, T u)
 Template to clamp an object of type T to a lower and an upper limit. More...

float degToRad (float angle)
 Transform an angle in degrees to radians. More...

bool isPowerOfTwo (int n)
 Determine if an integer is a power of two. More...

template<typename T> T lerp (float alpha, const T &v0, const T &v1)
 Linear interpolation between two values v0 and v1. More...

int powerOfTwoBelow (int n)
 Determine the largest integer power of two below an integer. More...

float radToDeg (float angle)
 Transform an angle in radian to degree. More...

template<typename T> int sign (const T &t)
 Determine the sign of a scalar. More...

template<typename T> float square (const T &t)
 Template to square an object of Type T. More...


Variables

NVSG_API const Mat44f cIdentity44f
 global identity matrix. More...

const float PI = 3.14159265358979323846f
 constant PI. More...

const float PI_HALF = 1.57079632679489661923f
 constant PI half. More...

const float PI_QUARTER = 0.78539816339744830962f
 constant PI quarter. More...

const float SQRT_TWO = 1.41421356237309504880f
 constant square root two. More...

const float SQRT_TWO_HALF = 0.70710678118654752440f
 constant square root two half. More...

NVSG_API const Sphere3f cUnitSphere
 global unit sphere. More...


Detailed Description

Namespace for mathematical helper functions and classes.

Function Documentation

template<class T>
T clamp   v,
  l,
  u
 

Template to clamp an object of type T to a lower and an upper limit.

Returns:
clamped value of v between l and u
Parameters:
v  value to clamp
l  lower limit
u  upper limit

float degToRad float    angle [inline]
 

Transform an angle in degrees to radians.

Returns:
angle in radians
Parameters:
angle  angle in degrees

bool isPowerOfTwo int    n [inline]
 

Determine if an integer is a power of two.

Returns:
true if n is a power of two, otherwise false
Parameters:
n  integer to test

template<typename T>
T lerp float    alpha,
const T &    v0,
const T &    v1
 

Linear interpolation between two values v0 and v1.

v = v0 + alpha * ( v1 - v0 )

Parameters:
alpha  interpolation parameter
v0  starting value
v1  ending value

int powerOfTwoBelow int    n [inline]
 

Determine the largest integer power of two below an integer.

Returns:
largest power of two below n
Parameters:
n  integer to use as the upper limit

float radToDeg float    angle [inline]
 

Transform an angle in radian to degree.

Returns:
angle in degrees
Parameters:
angle  angle in radians

template<typename T>
int sign const T &    t
 

Determine the sign of a scalar.

Returns:
sign of t
Parameters:
t  scalar value

template<typename T>
float square const T &    t
 

Template to square an object of Type T.

Returns:
product of t with itself
Parameters:
t  object to square


Variable Documentation

NVSG_API const Mat44f nvmath::cIdentity44f
 

global identity matrix.

const float nvmath::PI = 3.14159265358979323846f
 

constant PI.

const float nvmath::PI_HALF = 1.57079632679489661923f
 

constant PI half.

const float nvmath::PI_QUARTER = 0.78539816339744830962f
 

constant PI quarter.

const float nvmath::SQRT_TWO = 1.41421356237309504880f
 

constant square root two.

const float nvmath::SQRT_TWO_HALF = 0.70710678118654752440f
 

constant square root two half.

NVSG_API const Sphere3f nvmath::cUnitSphere
 

global unit sphere.


Generated on Tue Mar 1 13:20:22 2005 for NVSGSDK by NVIDIA