IC Python API:RLPy RMath

From Reallusion Wiki!
Jump to: navigation, search

Contents

Main article: Modules.

Detailed Description

this class provide the common mathematical functions

Member Functions

Abs

RLPy.RMath.Abs ( a )

Computes absolute value of an integral value.

Parameters

a [IN] Floating-point value - float

Returns

The absolute value of n (i.e. n), if it is representable - float

ACos

RLPy.RMath.ACos ( fValue )

Computes arc cosine.

Parameters

fValue [IN] Floating-point value - float

Returns

The arc cosine of value in the range [0 , π], is returned - float

AlmostZero

RLPy.RMath.AlmostZero ( tValue )

Is the value almost zero.

Parameters

tValue [IN] Floating-point value - float

Returns

Return true while the value is almost zero - bool

ASin

RLPy.RMath.ASin ( fValue )

Computes arc sine.

Parameters

fValue [IN] Floating-point value - float

Returns

The arc cosine of value in the range in the range [-π/2,+π/2], is returned - float

ATan

RLPy.RMath.ATan ( fValue )

Computes arc tangent.

Parameters

fValue [IN] Floating-point value - float

Returns

The arc cosine of value in the range in the range [-π/2,+π/2], is returned - float

ATan2

RLPy.RMath.ATan2 ( fY, fX )

Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant.

Parameters

fY [IN] Floating-point value - float

fX [IN] Floating-point value - float

Returns

The arc tangent of y/x in the range (-π , +π] radians, is returned - float

Bezier3

RLPy.RMath.Bezier3 ( a, b, c, d, t )

Computes bezier curve.

Parameters

a [IN] Floating-point value - float

b [IN] Floating-point value - float

c [IN] Floating-point value - float

d [IN] Floating-point value - float

t [IN] Floating-point value - float

Returns

The value of the bezier curve - float

Ceil

RLPy.RMath.Ceil ( fValue )

Nearest integer not less than the given value.

Parameters

fValue [IN] Floating-point value - float

Returns

The smallest integer value not less than arg, is returned - float

Clamp

RLPy.RMath.Clamp ( tMax, tMin, tValue )

Return the value between tMax and tMin.

Parameters

tMax [IN] Maximum value - float

tMin [IN] Minimum value - float

tValue [IN] Floating-point value - float

Returns

If tValue > tMax, return tMax. if tValue < tMin, return tMin. Otherwise retrun tValue - float

CopySign

RLPy.RMath.CopySign ( fValue )

Copies the sign of a floating point value.

Parameters

fValue [IN] Floating-point value - float

Returns

Return -1 if the input is negative, else 1 - float

Cos

RLPy.RMath.Cos ( fValue )

Computes cosine.

Parameters

fValue [IN] Value representing angle in radians - float

Returns

The cosine of arg in the range [-1 ; +1], is returned - float

Equal

RLPy.RMath.Equal ( tValue1, tValue2 )

Two value are equal or not.

Parameters

tValue1 [IN] Floating-point value - float

tValue2 [IN] Floating-point value - float

Returns

Return true while two value is almost equal - bool

Erf

RLPy.RMath.Erf ( fX )

Computes polynomial approximation.

Parameters

fX [IN] Floating-point value - float

Returns

Polynomial approximation - float

Erfc

RLPy.RMath.Erfc ( fX )

Computes 1-erf(x)

Parameters

fX [IN] Floating-point value - float

Returns

Erfc(x) = 1-erf(x) - float

Exp

RLPy.RMath.Exp ( fValue )

Returns e raised to the given power (ex)

Parameters

fValue [IN] Floating-point value - float

Returns

The base-e exponential of arg is returned - float

FAbs

RLPy.RMath.FAbs ( fValue )

Absolute value of a floating point value.

Parameters

fValue [IN] Floating-point value - float

Returns

The absolute value of arg - float

FastCos0

RLPy.RMath.FastCos0 ( fAngle )

Fast evaluation of cos(angle) by polynomial approximations.

Parameters

fAngle [IN] Value representing angle in radians, of a floating-point. The angle must be in [0,π/2] - float

Returns

The sine of arg in the

range [-1 ; +1], is returned. The maximum absolute error is about 1.2e-03. The speed up is about 2 - float


FastCos1

RLPy.RMath.FastCos1 ( fAngle )

Fast evaluation of cos(angle) by polynomial approximations.

Parameters

fAngle [IN] Value representing angle in radians, of a floating-point. The angle must be in [0,π/2] - float

Returns

The sine of arg in the

range [-1 ; +1], is returned. The maximum absolute error is about 2.3e-09. The speed up is about 1.5 - float


FastInvCos

RLPy.RMath.FastInvCos ( fValue )

Fast evaluation of acos(value) by a sqrt times a polynomial.

Parameters

fValue [IN] Floating-point value. The value must be in [0,1] - float

Returns

The sine of arg is returned. The maximum absolute error is about 6.8e-05. The speed up is about 2.5 - float

FastInvSin

RLPy.RMath.FastInvSin ( fValue )

Fast evaluation of asin(value) by a sqrt times a polynomial.

Parameters

fValue [IN] Floating-point value. The value must be in [0,1] - float

Returns

The sine of arg is returned. The maximum absolute error is about 6.8e-05. The speed up is about 2.5 - float

FastInvSqrt_Walsh

RLPy.RMath.FastInvSqrt_Walsh ( tValue )

A fast approximation to 1/sqrt using The Quake 3 Walsh Method.

Parameters

tValue [IN] Floating-point value - float

Returns

The inverse of square root - float

FastInvTan0

RLPy.RMath.FastInvTan0 ( fValue )

Fast evaluation of atan(value) by polynomial approximations.

Parameters

fValue [IN] Floating-point value. The value must be in [-1,1] - float

Returns

The atan of arg is returned. The maximum absolute error is about 1.2e-05. The speed up is about 2.2 - float

FastInvTan1

RLPy.RMath.FastInvTan1 ( fValue )

Fast evaluation of atan(value) by polynomial approximations.

Parameters

fValue [IN] Floating-point value. The value must be in [-1,1] - float

Returns

The atan of arg is returned. The maximum absolute error is about 1.43-08. The speed up is about 1.5 - float

FastSin0

RLPy.RMath.FastSin0 ( fAngle )

Fast evaluation of sin(angle) by polynomial approximations.

Parameters

fAngle [IN] Value representing angle in radians, of a floating-point. The angle must be in [0,π/2] - float

Returns

The sine of arg in the

range [-1 ; +1], is returned. The maximum absolute error is about 1.7e-04. The speed up is about 2 - float


FastSin1

RLPy.RMath.FastSin1 ( fAngle )

Fast evaluation of sin(angle) by polynomial approximations.

Parameters

fAngle [IN] Value representing angle in radians, of a floating-point. The angle must be in [0,π/2] - float

Returns

The sine of arg in the

range [-1 ; +1], is returned. The maximum absolute error is about 2.3e-09. The speed up is about 1.5 - float


FastSqrt_LogBase2

RLPy.RMath.FastSqrt_LogBase2 ( tValue )

Approximations that depend on IEEE representation.

Parameters

tValue [IN] Floating-point value - float

Returns

The value of square root. This method is 5 times speed up over sqrt() - float

FastSqrt_Walsh

RLPy.RMath.FastSqrt_Walsh ( tValue )

A fast approximation to sqrt() using The Quake 3 Walsh Method.

Parameters

tValue [IN] Floating-point value - float

Returns

The value of square root. This method is 2 times speed up over sqrt() - float

FastTan0

RLPy.RMath.FastTan0 ( fAngle )

Fast evaluation of tan(angle) by polynomial approximations.

Parameters

fAngle [IN] Value representing angle in radians, of a floating-point. The angle must be in [0,π/4] - float

Returns

The tangent of arg is returned. The maximum absolute error is about 8.1e-04. The speed up is about 2.5 - float

FastTan1

RLPy.RMath.FastTan1 ( fAngle )

Fast evaluation of tan(angle) by polynomial approximations.

Parameters

fAngle [IN] Value representing angle in radians, of a floating-point. The angle must be in [0,π/4] - float

Returns

The tangent of arg is returned. The maximum absolute error is about 1.9e-08. The speed up is about 1.75 - float

Floor

RLPy.RMath.Floor ( fValue )

Nearest integer not greater than the given value.

Parameters

fValue [IN] Floating-point value - float

Returns

The largest integer value not greater than arg, is returned - float

FMod

RLPy.RMath.FMod ( fX, fY )

Remainder of the floating point division operation.

Parameters

fX [IN] Floating-point value - float

fY [IN] Floating-point value - float

Returns

The floating-point remainder of the division x/y as defined above - float

Gamma

RLPy.RMath.Gamma ( fX )

Computes gamma.

Parameters

fX [IN] Floating-point value - float

Returns

The value of gamma - float

IncompleteGamma

RLPy.RMath.IncompleteGamma ( fA, fX )

Computes incomplete gamma.

Parameters

fA [IN] Floating-point value - float

fX [IN] Floating-point value - float

Returns

The value of gamma - float

IntervalRandom

RLPy.RMath.IntervalRandom ( args )

Generate a random number in [min,max).

Parameters

fMin [IN] Minimum value - float

fSeed [IN] maximum value - float

fSeed [IN] Seeded value - float

Returns

The random number generator may be seeded by a first call to IntervalRandom with a positive seed - float

InvSqrt

RLPy.RMath.InvSqrt ( fValue )

Computes inverse of square root (1/sqrt)

Parameters

fValue [IN] Floating-point value - float

Returns

The inverse of square root - float

Log

RLPy.RMath.Log ( fValue )

Computes natural (base e) logarithm.

Parameters

fValue [IN] Floating-point value - float

Returns

The natural (base-e) logarithm of arg is returned - float

LogGamma

RLPy.RMath.LogGamma ( fX )

Computes log gamma.

Parameters

fX [IN] Floating-point value - float

Returns

The value of log gamma - float

Max

RLPy.RMath.Max ( a, b )

Larger of two floating point values.

Parameters

a [IN] Floating-point value - float

b [IN] Floating-point value - float

Returns

The larger of two floating point values - float

Min

RLPy.RMath.Min ( a, b )

Smaller of two floating point values.

Parameters

a [IN] Floating-point value - float

b [IN] Floating-point value - float

Returns

The smaller of two floating point values - float

ModBessel0

RLPy.RMath.ModBessel0 ( fX )

Modified Bessel functions of order 0.

Parameters

fX [IN] Floating-point value - float

Returns

The value of modified bessel - float

ModBessel1

RLPy.RMath.ModBessel1 ( fX )

Modified Bessel functions of order 1.

Parameters

fX [IN] Floating-point value - float

Returns

The value of modified bessel - float

Pow

RLPy.RMath.Pow ( fBase, fExponent )

Raises a number to the given power.

Parameters

fBase [IN] Base as a value of floating-point - float

fExponent [IN] Exponent as a value of floating-point - float

Returns

Base raised to the power of exp, is returned - float

Round

RLPy.RMath.Round ( tValue )

Nearest floating point.

Parameters

tValue [IN] Floating-point value - float

Returns

The nearest flaoting value to arg - float

RoundAlmostZero

RLPy.RMath.RoundAlmostZero ( tValue )

Round Almost Zero.

Parameters

tValue1 [IN] Floating-point value.

Returns

Return RoundAlmostZero - float

RoundEpsilonZero

RLPy.RMath.RoundEpsilonZero ( tValue )

Round Epsilon Zero.

Parameters

tValue1 [IN] Floating-point value.

Returns

Return RoundEpsilonZero - float

Sign

RLPy.RMath.Sign ( fValue )

Sign of a floating point value.

Parameters

fValue [IN] Floating-point value - float

Returns

Return -1 if the input is negative, 0 if the input is zero, and +1 if the input is positive - float

Sin

RLPy.RMath.Sin ( fValue )

Computes sine.

Parameters

fValue [IN] Value representing angle in radians, of a floating-point - float

Returns

The sine of arg in the range [-1 ; +1], is returned - float

Sqr

RLPy.RMath.Sqr ( fValue )

Computes square.

Parameters

fValue [IN] Floating-point value - float

Returns

Square of arg, fAvale*fValue, is returned - float

Sqrt

RLPy.RMath.Sqrt ( fValue )

Computes square root.

Parameters

fValue [IN] Floating-point value - float

Returns

Square root of arg, is returned - float

SymmetricRandom

RLPy.RMath.SymmetricRandom ( args )

Generate a random number in [-1,1).

Parameters

fSeed [IN] Seeded value - float

Returns

The random number generator may be seeded by a first call to SymmetricRandom with a positive seed - float

Tan

RLPy.RMath.Tan ( fValue )

Computes tangent.

Parameters

fValue [IN] Value representing angle in radians, of a floating-point - float

Returns

The tangent of arg is returned - float

UnitRandom

RLPy.RMath.UnitRandom ( args )

Generate a random number in [0,1).

Parameters

fSeed [IN] Seeded value - float

Returns

The random number generator may be seeded by a first call to UnitRandom with a positive seed - float