DzMath Class Reference
[General Objects]

DAZ Script's global static object for mathmatical constants and functions. More...

List of all members.

Properties

Number E
Number LN10
Number LN2
Number LOG10E
Number LOG2E
Number PI
Number SQRT1_2
Number SQRT2

Methods

Number abs (Number num)
Number acos (Number num)
Number asin (Number num)
Number atan (Number num)
Number atan2 (Number yCoord, Number xCoord)
Number ceil (Number num)
Number cos (Number num)
Number exp (Number num)
Number floor (Number num)
Number log (Number num)
Number max (Number num1, Number num2)
Number min (Number num1, Number num2)
Number pow (Number num, Number power)
Number random ()
Number round (Number num)
Number sin (Number num)
Number sqrt (Number num)
Number tan (Number num)


Detailed Description

DAZ Script's global static object for mathmatical constants and functions.

The DzMath object implements mathematical constants and functions. It is accessible via the Math global variable.

Todo:
Examples:


Member Function Documentation

Number DzMath::abs ( Number  num  ) 

Returns:
The absolute value of num.
Parameters:
num The number to take the absolute value of
Example:
EXAMPLE

Number DzMath::acos ( Number  num  ) 

Returns:
The arccosine of num in radians between 0 and PI. If num is out of range, returns NaN.
Parameters:
num The number to calculate the arc cosine of
Example:
EXAMPLE

Number DzMath::asin ( Number  num  ) 

Returns:
The arcsine of num in radians between -PI/2 and PI/2. If num is out of range, returns NaN.
Parameters:
num The number to calculate the arc sine of
Example:
EXAMPLE

Number DzMath::atan ( Number  num  ) 

Returns:
The arctangent of num in radians between -PI/2 and PI/2. If num is out of range, returns NaN.
Parameters:
num The number to calculate the arc tangent of
Example:
EXAMPLE

Number DzMath::atan2 ( Number  yCoord,
Number  xCoord 
)

Returns:
The counter-clockwise angle in radians between the positive x-axis and the point at (xCoord, yCoord). The value returned is always between -PI and PI.
Parameters:
yCoord The y coordinate of the position to get the arc tangent for
xCoord The x coordinate of the position to get the arc tangent for
Example:
EXAMPLE

Number DzMath::ceil ( Number  num  ) 

Returns:
If num is an integer, returns num. If num is a float, returns the smallest integer greater than num.
Parameters:
num The number to get the ceiling for
Example:
EXAMPLE

Number DzMath::cos ( Number  num  ) 

Returns:
The cosine of num. The value will be in the range [-1,1].
Parameters:
num The angle, in radians, to calculate the cosine of
Example:
EXAMPLE

Number DzMath::exp ( Number  num  ) 

Returns:
E raised to the power of num.
Parameters:
num The exponent to calculate
Example:
EXAMPLE

Number DzMath::floor ( Number  num  ) 

Returns:
If num is an integer, returns num. If num is a float, returns the greatest integer less than num.
Parameters:
num The number to get the floor for
Example:
EXAMPLE

Number DzMath::log ( Number  num  ) 

Returns:
If num is > 0, returns the natural logarithm of num. If num is 0, returns Infinity. If num is < 0, returns NaN.
Parameters:
num The number to calculate the logarithm of.
Example:
EXAMPLE

Number DzMath::max ( Number  num1,
Number  num2 
)

Returns:
The larger of num1 and num2.
Parameters:
num1 The first number to test
num2 The second number to test
Example:
EXAMPLE

Number DzMath::min ( Number  num1,
Number  num2 
)

Returns:
The smaller of num1 and num2.
Parameters:
num1 The first number to test
num2 The second number to test
Example:
EXAMPLE

Number DzMath::pow ( Number  num,
Number  power 
)

Returns:
The value of num raised to power.
Parameters:
num The number to calculate the exponent of
power The exponent of the number to calculate
Example:
EXAMPLE

Number DzMath::random (  ) 

Returns:
A pseudo-random float between 0 and 1. Pseudo random numbers are not truly random, but may be adequate for some applications, for example, games and simple simulations.
Example:
EXAMPLE

Number DzMath::round ( Number  num  ) 

Returns:
num rounded to the nearest integer. If the fractional part of num is >= 0.5, num is rounded up; otherwise it is rounded down.
Parameters:
num The number to round off
Example:
EXAMPLE

Number DzMath::sin ( Number  num  ) 

Returns:
The sine of num. The value will be in the range [-1,1].
Parameters:
num The angle, in radians, to calculate the sine of
Example:
EXAMPLE

Number DzMath::sqrt ( Number  num  ) 

Returns:
If num is >= 0, returns the square root. If num is < 0, returns NaN.
Parameters:
num The number to calculate the square root of.
Example:
EXAMPLE

Number DzMath::tan ( Number  num  ) 

Returns:
The tangent of num.
Parameters:
num The angle, in radians, to calculate the tangent of
Example:
EXAMPLE


Member Data Documentation

Number DzMath::E

Euler's constant. The base for natural logarithms. (Read Only)

Number DzMath::LN10

Natural logarithm of 10. (Read Only)

Number DzMath::LN2

Natural logarithm of 2. (Read Only)

Number DzMath::LOG10E

Base 10 logarithm of E. (Read Only)

Number DzMath::LOG2E

Base 2 logarithm of E. (Read Only)

Number DzMath::PI

Pi (3.141592653589793). (Read Only)

Number DzMath::SQRT1_2

Square root of 1/2. (Read Only)

Number DzMath::SQRT2

Square root of 2. (Read Only)


Generated on Thu Sep 24 12:21:13 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.