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

# deMath.hpp File Reference

Math lib header. More...

`#include "deGlobalTypes.hpp"`
`#include "deStack.hpp"`
`#include <cmath>`

Include dependency graph for deMath.hpp:

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

Go to the source code of this file.

## Namespaces
namespace | deGeometry
## Compounds
class | deFraction
struct | deFractionInfo
class | deMatrix44
class | deQuaternion
| a quaternion calculation class More...
class | deTransform
| rigid-body transformation. supports a translation and rotation, with possible scaling. More...
struct | deTransformInfo
| storage class for a Destiny3D transform More...
class | deTransformStack
struct | deVec4d
## Functions
template<typename T> T | SQUARE (T x)
deDouble | Vec3d_LengthSq (const deVec3d &v)
| squared length of a deVec3d
deDouble | Vec3d_Length (const deVec3d &v)
| length of a deVec3d
void | Vec3d_ScaleByVec (deVec3d &v1, const deVec3d &v2)
| multiply each component of a deVec3d by the corresponding component of another
deBoolean | Compare_Epsilon (const deDouble d1, const deDouble d2, deDouble epsilon=0.00001)
| compare equality of 2 floating-point values, within some Epsilon value
deBoolean | Vec3d_Compare (const deVec3d &v1, const deVec3d &v2, deDouble epsilon=0.00001)
| compare equality of two deVec3d, within some Epsilon value
deBoolean | Vec3d_CompareOpposite (const deVec3d &v1, const deVec3d &v2, deDouble epsilon=0.00001)
| compare exact opposite equality of two deVec3d, within some Epsilon value
deDouble | Vec3d_Dot (const deVec3d &v1, const deVec3d &v2)
| compute the dot-product of two deVec3d (deDouble components)
deFloat | Vec3d_Dot (const deVertex &v1, const deVertex &v2)
| compute the dot-product of two deVertex (deFloat components)
deDouble | Vec3d_DistSq (const deVec3d &v1, const deVec3d &v2)
| compute the square of the distance between two deVec3d
deDouble | Vec3d_Dist (const deVec3d &v1, const deVec3d &v2)
| compute the distance between two deVec3d
deFloat | Vec3d_DistSq (const deVertex &v1, const deVertex &v2)
| compute the square of the distance between two deVertex
deFloat | Vec3d_Dist (const deVertex &v1, const deVertex &v2)
| compute the distance between two deVertex
deVec3d | operator- (const deVec3d &v)
| compute the inverse of a deVec3d (overloaded operator-)
deVec3d | operator- (const deVec3d &v1, const deVec3d &v2)
| compute the component difference between two deVec3d (overloaded operator-)
deVec3d | operator+ (const deVec3d &v1, const deVec3d &v2)
| compute the component sum of two deVec3d (overloaded operator+)
deVec3d | operator * (const deVec3d &v1, deDouble d)
| compute the scalar product of a deVec3d and a floating-point value (overloaded operator*)
void | operator-= (deVec3d &v1, const deVec3d &v2)
| subtract a deVec3d from another one (overloaded operator-=)
void | operator+= (deVec3d &v1, const deVec3d &v2)
| add a deVec3d to another one (overloaded operator+=)
void | operator *= (deVec3d &v1, deDouble d)
| multiply a deVec3d by a scalar value (overloaded operator*=)
void | operator/= (deVec3d &v1, deDouble d)
| divide a deVec3d by a scalar value (overloaded operator/=)
deDouble & | Vec3d_GetElement (const deVec3d &v, long i)
| obtain a reference to an indexed value inside a 3d vector (valid index values: {0,1,2}, map to {x,y,z})
deVertex | operator- (const deVertex &v)
| compute the inverse of a deVertex (overloaded operator-)
deVertex | operator- (const deVertex &v1, const deVertex &v2)
| compute the component difference between two deVertex (overloaded operator-)
deVertex | operator+ (const deVertex &v1, const deVertex &v2)
| compute the component sum of two deVertex (overloaded operator+)
deVertex | operator * (const deVertex &v1, deFloat f)
| compute the scalar product of a deVertex and a floating-point value (overloaded operator*)
void | operator-= (deVertex &v1, const deVertex &v2)
| subtract a deVertex from another one (overloaded operator-=)
void | operator+= (deVertex &v1, const deVertex &v2)
| add a deVertex to another one (overloaded operator+=)
void | operator *= (deVertex &v1, deFloat d)
| multiply a deVertex by a scalar value (overloaded operator*=)
void | operator/= (deVertex &v1, deFloat d)
| divide a deVertex by a scalar value (overloaded operator/=)
deTexCoord | operator- (const deTexCoord &v1, const deTexCoord &v2)
deTexCoord | operator+ (const deTexCoord &v1, const deTexCoord &v2)
deTexCoord | operator * (const deTexCoord &v1, deFloat f)
void | operator-= (deTexCoord &v1, const deTexCoord &v2)
void | operator+= (deTexCoord &v1, const deTexCoord &v2)
void | operator *= (deTexCoord &v1, deFloat d)
void | operator/= (deTexCoord &v1, deFloat d)
void | operator *= (deColor &lhs, const deColor &rhs)
| multiply each component of a deColor by the corresponding component of another
void | Vec3d_Squeeze (deVec3d &v, deDouble Epsilon=0.00001)
void | Vec3d_Cross (const deVec3d &V1, const deVec3d &V2, deVec3d &Result)
| compute the cross product of two deVec3d
void | Vec3d_Cross (const deVertex &V1, const deVertex &V2, deVertex &Result)
| compute the cross product of two deVertex
deVec3d | Vec3d_Cross (const deVec3d &V1, const deVec3d &V2)
deDouble | Vec3d_Normalize (deVec3d &V)
deFloat | Vertex_Normalize (deVertex &V)
deARGB | Vec3d_ConvertToDot3 (const deVec3d &V1, deFloat Height)
| compute the 32-bit deARGB value for a normalized deVec3d (for dot3 bumpmapping)
deARGB | Vec3d_ConvertToDot3Clamp (const deVec3d &V1, deFloat Height)

## Detailed Description

Math lib header.

Author:
  Assassin

This file is the intellectual property of Novus Delta, LLC.. Usage of the contents of this file is subject to the Destiny3D Member License which can be found at http://www.destiny3d.com. Any other usage is prohibited.

This file is distributed "AS IS" without warranty of any kind. Novus Delta, LLC. does not guarantee the fitness of the contents of this file for any particular purpose.

Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.

Change History

Date:
  Jan 2002

Author:
  Assassin

Remarks:
  Creation

Date:
  Jul 2002

Author:
  Hootie

Remarks:
  Convert to static lib

## Function Documentation

deBoolean Compare_Epsilon | ( | const deDouble | d1,
|  | const deDouble | d2,
|  | deDouble | epsilon = 0.00001
| ) | `[inline, static]`

| compare equality of 2 floating-point values, within some Epsilon value

deTexCoord operator * | ( | const deTexCoord & | v1,
|  | deFloat | f
| ) | `[inline, static]`

deVertex operator * | ( | const deVertex & | v1,
|  | deFloat | f
| ) | `[inline, static]`

| compute the scalar product of a deVertex and a floating-point value (overloaded operator*)

deVec3d operator * | ( | const deVec3d & | v1,
|  | deDouble | d
| ) | `[inline, static]`

| compute the scalar product of a deVec3d and a floating-point value (overloaded operator*)

void operator *= | ( | deColor & | lhs,
|  | const deColor & | rhs
| ) | `[inline, static]`

| multiply each component of a deColor by the corresponding component of another

void operator *= | ( | deTexCoord & | v1,
|  | deFloat | d
| ) | `[inline, static]`

void operator *= | ( | deVertex & | v1,
|  | deFloat | d
| ) | `[inline, static]`

| multiply a deVertex by a scalar value (overloaded operator*=)

void operator *= | ( | deVec3d & | v1,
|  | deDouble | d
| ) | `[inline, static]`

| multiply a deVec3d by a scalar value (overloaded operator*=)

deTexCoord operator+ | ( | const deTexCoord & | v1,
|  | const deTexCoord & | v2
| ) | `[inline, static]`

deVertex operator+ | ( | const deVertex & | v1,
|  | const deVertex & | v2
| ) | `[inline, static]`

| compute the component sum of two deVertex (overloaded operator+)

deVec3d operator+ | ( | const deVec3d & | v1,
|  | const deVec3d & | v2
| ) | `[inline, static]`

| compute the component sum of two deVec3d (overloaded operator+)

void operator+= | ( | deTexCoord & | v1,
|  | const deTexCoord & | v2
| ) | `[inline, static]`

void operator+= | ( | deVertex & | v1,
|  | const deVertex & | v2
| ) | `[inline, static]`

| add a deVertex to another one (overloaded operator+=)

void operator+= | ( | deVec3d & | v1,
|  | const deVec3d & | v2
| ) | `[inline, static]`

| add a deVec3d to another one (overloaded operator+=)

deTexCoord operator- | ( | const deTexCoord & | v1,
|  | const deTexCoord & | v2
| ) | `[inline, static]`

deVertex operator- | ( | const deVertex & | v1,
|  | const deVertex & | v2
| ) | `[inline, static]`

| compute the component difference between two deVertex (overloaded operator-)

deVertex operator- | ( | const deVertex & | v | ) | `[inline, static]`

| compute the inverse of a deVertex (overloaded operator-)

deVec3d operator- | ( | const deVec3d & | v1,
|  | const deVec3d & | v2
| ) | `[inline, static]`

| compute the component difference between two deVec3d (overloaded operator-)

deVec3d operator- | ( | const deVec3d & | v | ) | `[inline, static]`

| compute the inverse of a deVec3d (overloaded operator-)

void operator-= | ( | deTexCoord & | v1,
|  | const deTexCoord & | v2
| ) | `[inline, static]`

void operator-= | ( | deVertex & | v1,
|  | const deVertex & | v2
| ) | `[inline, static]`

| subtract a deVertex from another one (overloaded operator-=)

void operator-= | ( | deVec3d & | v1,
|  | const deVec3d & | v2
| ) | `[inline, static]`

| subtract a deVec3d from another one (overloaded operator-=)

void operator/= | ( | deTexCoord & | v1,
|  | deFloat | d
| ) | `[inline, static]`

void operator/= | ( | deVertex & | v1,
|  | deFloat | d
| ) | `[inline, static]`

| divide a deVertex by a scalar value (overloaded operator/=)

void operator/= | ( | deVec3d & | v1,
|  | deDouble | d
| ) | `[inline, static]`

| divide a deVec3d by a scalar value (overloaded operator/=)

template<typename T>
T SQUARE | ( | T | x | ) | `[inline, static]`

deBoolean Vec3d_Compare | ( | const deVec3d & | v1,
|  | const deVec3d & | v2,
|  | deDouble | epsilon = 0.00001
| ) | `[inline, static]`

| compare equality of two deVec3d, within some Epsilon value

deBoolean Vec3d_CompareOpposite | ( | const deVec3d & | v1,
|  | const deVec3d & | v2,
|  | deDouble | epsilon = 0.00001
| ) | `[inline, static]`

| compare exact opposite equality of two deVec3d, within some Epsilon value

deARGB Vec3d_ConvertToDot3 | ( | const deVec3d & | V1,
|  | deFloat | Height
| ) |

| compute the 32-bit deARGB value for a normalized deVec3d (for dot3 bumpmapping)

deARGB Vec3d_ConvertToDot3Clamp | ( | const deVec3d & | V1,
|  | deFloat | Height
| ) |

deVec3d Vec3d_Cross | ( | const deVec3d & | V1,
|  | const deVec3d & | V2
| ) | `[inline, static]`

void Vec3d_Cross | ( | const deVertex & | V1,
|  | const deVertex & | V2,
|  | deVertex & | Result
| ) |

| compute the cross product of two deVertex

void Vec3d_Cross | ( | const deVec3d & | V1,
|  | const deVec3d & | V2,
|  | deVec3d & | Result
| ) |

| compute the cross product of two deVec3d

deFloat Vec3d_Dist | ( | const deVertex & | v1,
|  | const deVertex & | v2
| ) | `[inline, static]`

| compute the distance between two deVertex

deDouble Vec3d_Dist | ( | const deVec3d & | v1,
|  | const deVec3d & | v2
| ) | `[inline, static]`

| compute the distance between two deVec3d

deFloat Vec3d_DistSq | ( | const deVertex & | v1,
|  | const deVertex & | v2
| ) | `[inline, static]`

| compute the square of the distance between two deVertex

deDouble Vec3d_DistSq | ( | const deVec3d & | v1,
|  | const deVec3d & | v2
| ) | `[inline, static]`

| compute the square of the distance between two deVec3d

deFloat Vec3d_Dot | ( | const deVertex & | v1,
|  | const deVertex & | v2
| ) | `[inline, static]`

| compute the dot-product of two deVertex (deFloat components)

deDouble Vec3d_Dot | ( | const deVec3d & | v1,
|  | const deVec3d & | v2
| ) | `[inline, static]`

| compute the dot-product of two deVec3d (deDouble components)

deDouble& Vec3d_GetElement | ( | const deVec3d & | v,
|  | long | i
| ) | `[inline, static]`

| obtain a reference to an indexed value inside a 3d vector (valid index values: {0,1,2}, map to {x,y,z})

deDouble Vec3d_Length | ( | const deVec3d & | v | ) | `[inline, static]`

| length of a deVec3d

deDouble Vec3d_LengthSq | ( | const deVec3d & | v | ) | `[inline, static]`

| squared length of a deVec3d

deDouble Vec3d_Normalize | ( | deVec3d & | V | ) |

| normalize a deVec3d Returns: the length of the original vector

void Vec3d_ScaleByVec | ( | deVec3d & | v1,
|  | const deVec3d & | v2
| ) | `[inline, static]`

| multiply each component of a deVec3d by the corresponding component of another

void Vec3d_Squeeze | ( | deVec3d & | v,
|  | deDouble | Epsilon = 0.00001
| ) |

| "squeeze" the components of a deVec3d: if they are within Epsilon units of zero, set them to zero. Useful for getting "perfect" orthographic orientations after moving around a bit

deFloat Vertex_Normalize | ( | deVertex & | V | ) |

| normalize a deVertex Returns: the length of the original vector