Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

real.inl File Reference

Go to the source code of this file.

Functions

bool feq (Real a, Real b, Real e)
 Equal: a == b.

bool fneq (Real a, Real b, Real e)
 Not equal: a != b.

bool fle (Real a, Real b, Real e)
 Less or equal: a <= b.

bool fge (Real a, Real b, Real e)
 Greater or equal: a >= b.

bool fz (Real a, Real e)
 Zero: a == 0.

bool fnz (Real a, Real e)
 Not zero: a != 0.

template<typename T> T sq (T x)
Real dtor (Real d)
 Convert degrees to radians.

Real rtod (Real r)
 Convert radians to degrees.

Real NormalizeAngle (Real angle)
int NextPowerOfTwo (double x)


Function Documentation

Real dtor Real  d  )  [inline]
 

Convert degrees to radians.

Definition at line 65 of file real.inl.

References sheep::PI.

Referenced by toxic::SceneBuilder::mesh_builder(), toxic::SceneBuilder::pinholecamera_builder(), toxic::SceneBuilder::rotation_builder(), and toxic::SceneBuilder::thinlenscamera_builder().

bool feq Real  a,
Real  b,
Real  e = EPS
[inline]
 

Equal: a == b.

Used to test two floating point numbers to see if they are close enough to be considered equal (not equal, less or equal, greater or equal, zero, not zero). Based on code by Robert Martin (rmartin@rcmcon.com).

Definition at line 24 of file real.inl.

bool fge Real  a,
Real  b,
Real  e
[inline]
 

Greater or equal: a >= b.

Definition at line 45 of file real.inl.

References feq().

bool fle Real  a,
Real  b,
Real  e
[inline]
 

Less or equal: a <= b.

Definition at line 40 of file real.inl.

References feq().

bool fneq Real  a,
Real  b,
Real  e
[inline]
 

Not equal: a != b.

Definition at line 35 of file real.inl.

References feq().

bool fnz Real  a,
Real  e
[inline]
 

Not zero: a != 0.

Definition at line 55 of file real.inl.

bool fz Real  a,
Real  e
[inline]
 

Zero: a == 0.

Definition at line 50 of file real.inl.

int NextPowerOfTwo double  x  )  [inline]
 

Returns the smallest integer which can be expressed as a power of two, and which is greatest than x. x must be >= 1.

Definition at line 81 of file real.inl.

Referenced by sheep::Texture::set_texture().

Real NormalizeAngle Real  angle  )  [inline]
 

Expresses a given angle to [0, 2*Pi]. The input and output angles are expressed in radians.

Definition at line 75 of file real.inl.

References sheep::PI.

Referenced by PackSphericalCoords(), and sheep::SceneOrbiter::tumble().

Real rtod Real  r  )  [inline]
 

Convert radians to degrees.

Definition at line 70 of file real.inl.

References sheep::PI.

Referenced by display().

template<typename T>
T sq x  )  [inline]
 

Definition at line 60 of file real.inl.

Referenced by toxic::Ring::Intersect(), IsSquare(), sheep::MeshModifier::sub_mesh::OptimizeVertices(), sheep::Arcball::point_on_sphere(), and toxic::Ring::Ring().


Generated on Tue May 11 01:31:53 2004 for toxic by doxygen 1.3.6