Double Array Commands

About

This functionset gives you many commands you already know from mel (+ a few extras) wrapped so they work with arrays.

Important conventions

All commands don’t change the actual data in place, but create a new output.

Summary
This functionset gives you many commands you already know from mel (+ a few extras) wrapped so they work with arrays.
Create a double array
Get number of doubles in a double array
Append elements to the end of a double array
Get elements from a double array
Set elements in a double array, this function will not grow the double array, but error when you try to set an invalid array element!
Add two double arrays together elementwise
Subtract two double arrays elementwise
Multiply componentwise two double arrays together
Division of double and double
Negate doubles in an array
Check if two mDblArray elements are exactly equal
Check if mDblArray elements are not equal
Check if elements of two double arrays are equivalent within a tolerance
return the minimum of the two values
return the maximum of the two values
Get absolute value of doubles in an array
get the sign of a double, -1 if dbl<0, 0 if dbl=0 and 1 if dbl>0
Convert degrees to radians
Convert radians to degrees
Get sine value of doubles in an array
Get cosine value of doubles in an array
Get tangent value of doubles in an array
Get arc sine value of doubles in an array
Get arc cosine value of doubles in an array
Get arc tangent value of doubles in an array
Get hyperbolic sine value of doubles in an array
Get hyperbolic cosine value of doubles in an array
Get hyperbolic tangent value of doubles in an array
Get natural logarithm value of doubles in an array
Get base 10 logarithm value of doubles in an array
Raises the first argument to the power of the second argument
Returns the floating-point remainder of the division of it arguments A and B
round value towards zero to the nearest integer
get fractional part of a dbl
Get largest integral value not greater than value of doubles in an array
Compute smallest integral value not less than double in an array
Compute square root of double in an array
Compute cubic root of double in an array
linear interpolation of two doubles
Round mDblArray elements to a specific digit
clamp value between min and max value
returns 1 if A is between min and max (inclusive) 0 else
Returns value between 0 and 1 representing percentage of the distance between MIN and MAX represented by A.
Returns value between newMin and newMax that isrelative to A in the range between oldMin and oldMax

Functions

mDblCreate

#define mel mDblCreate(int $count,
float $template)

Create a double array

Parameters

nonereturn a single double value 0 or
countreturn count null doubles or
countthe number of double elements to create
templatethe template double which will be used for creation

Returns

The double array as a float array of its elements

mDblSize

#define mel int mDblSize(float $doubleArrayA[])

Get number of doubles in a double array

Parameters

doubleArrayAdouble array Returns:

The size of the double array

mDblAppend

#define mel mDblAppend(float $doubleArrayA[],
float $doubleArrayB[])

Append elements to the end of a double array

Parameters

doubleArrayAdouble array to extract elements to
doubleArrayBdouble array to append Returns:

The new double array of as a float array of its elements

mDblGet

#define mel mDblGet(float $doubleArrayA[],
int $id[],
float $doubleArrayB[])

Get elements from a double array

Parameters

doubleArrayAdouble array to extract elements from
idsint array of ids to extraxt from the double array optional
doubleArrayBdouble array that will be used as a substitution if an id does not exist in array A, must be 1 or same size than id array Returns:

The double array of as a float array of its elements

mDblSet

#define mel mDblSet(float $doubleArrayA[],
int $id[],
float $doubleArrayB[])

Set elements in a double array, this function will not grow the double array, but error when you try to set an invalid array element!

Parameters

doubleArrayAbase double array
idsint array of ids defining where in A to insert B
doubleArrayBdouble array of elements to be inserted into A, must be size 1 or same size than id array Returns:

The double arrayA with elements inserted of of as a float array of its elements

mDblAdd

#define mel mDblAdd(float[] $dblArrayA,
float[] $dblArrayB)

Add two double arrays together elementwise

Parameters

$dblArrayAthe first double array
$dblArrayBthe second double array

Returns

$dblArrayA + $dblArrayB, the sum of the two double arrays elementswise as a float[]

mDblSub

#define mel mDblSub(float[] $dblArrayA,
float[] $dblArrayB)

Subtract two double arrays elementwise

Parameters

$dblArrayAthe first double array
$dblArrayBthe second double array

Returns

$dblArrayA$dblArrayB, the difference of the two double arrays elementswise as a float[]

mDblMult

#define mel mDblMult(float[] $dblArrayA,
float[] $dblArrayB)

Multiply componentwise two double arrays together

Parameters

$dblArrayAthe first double array
$dblArrayBthe second double array

Returns

$dblArrayA * $dblArrayB, the produkt of the two double arrays as a float[]

mDblDiv

#define mel mDblDiv(float[] $dblArrayA,
float[] $dblArrayB)

Division of double and double

Parameters

$dblArrayAthe double array
$dblArrayBthe double array

Returns

$dblArrayA / $dblArrayB, the product of the two arrays as a float[]

mDblNegate

#define mel mDblNegate(float[] $dblArrayA)

Negate doubles in an array

Parameters

$dblArrayAthe double array

Returns

-($dblArrayA) , the negated doubles in an array as a float[]

mDblIsEqual

#define mel mDblIsEqual(float[] $dblArrayA,
float[] $dblArrayB)

Check if two mDblArray elements are exactly equal

Parameters

$dblArrayAthe first double array
$dblArrayBthe second double array

Returns

$dblArrayA == $dblArrayB, the result of the elementwise comparison as a float[] of (0,1)

mDblIsNotEqual

#define mel mDblIsNotEqual(float[] $dblArrayA,
float[] $dblArrayB)

Check if mDblArray elements are not equal

Parameters

$dblArrayAthe first double array
$dblArrayBthe second double array

Returns

$dblArrayA != $dblArrayB, the result of the elementwise comparison as a float[] of (0,1)

mDblIsEquivalent

#define mel mDblIsEquivalent(float[] $dblArrayA,
float[] $dblArrayB), float[] $toleranceArray)

Check if elements of two double arrays are equivalent within a tolerance

Parameters

$dblArrayAthe first matrix array
$dblArrayBthe second matrix array
$toleranceArraythe maximum amount of error allowed

Returns

the result of the comparison as a float array of (0,1)

mDblMin

#define mel mDblMin(float[] $dblArrayA,
float[] $dblArrayB)

return the minimum of the two values

Parameters

$dblArrayAthe first double array
$dblArrayBthe second double array

Returns

the result a float[]

mDblMax

#define mel mDblMax(float[] $dblArrayA,
float[] $dblArrayB)

return the maximum of the two values

Parameters

$dblArrayAthe first double array
$dblArrayBthe second double array

Returns

the result a float[]

mDblAbs

#define mel mDblAbs(float[] $dblArrayA)

Get absolute value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the absolut doubles as a float[]

mDblSign

#define mel mDblSign(float[] $dblArrayA)

get the sign of a double, -1 if dbl<0, 0 if dbl=0 and 1 if dbl>0

Parameters

$dblArrayAthe double array

Returns

the result in an array of float[]

mDblDegToRad

#define mel mDblDegToRad(float[] $dblArrayA)

Convert degrees to radians

Parameters

$dblArrayAthe double array

Returns

the converted doubles in an array of float[]

mDblRadToDeg

#define mel mDblRadToDeg(float[] $dblArrayA)

Convert radians to degrees

Parameters

$dblArrayAthe double array

Returns

the converted doubles in an array of float[]

mDblSin

#define mel mDblSin(float[] $dblArrayA)

Get sine value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the sine of doubles as a float[]

mDblCos

#define mel mDblCos(float[] $dblArrayA)

Get cosine value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the cosine of doubles as a float[]

mDblTan

#define mel mDblTan(float[] $dblArrayA)

Get tangent value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the tangent of doubles as a float[]

mDblASin

#define mel mDblASin(float[] $dblArrayA)

Get arc sine value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the arc sine of doubles as a float[]

mDblACos

#define mel mDblACos(float[] $dblArrayA)

Get arc cosine value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the arc cosine of doubles as a float[]

mDblATan

#define mel mDblATan(float[] $dblArrayA)

Get arc tangent value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the arc tangent of doubles as a float[]

mDblHSin

#define mel mDblHSin(float[] $dblArrayA)

Get hyperbolic sine value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the hyperbolic sine of doubles as a float[]

mDblHCos

#define mel mDblHCos(float[] $dblArrayA)

Get hyperbolic cosine value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the hyperbolic cosine of doubles as a float[]

mDblHTan

#define mel mDblHTan(float[] $dblArrayA)

Get hyperbolic tangent value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the hyperbolic tangent of doubles as a float[]

mDblLog

#define mel mDblLog(float[] $dblArrayA)

Get natural logarithm value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the natural logarithm of doubles as a float[]

mDblLog10

#define mel mDblLog10(float[] $dblArrayA)

Get base 10 logarithm value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the base 10 logarithm of doubles as a float[]

mDblPow

#define mel mDblPow(float $dblArrayA[],
int $dblArrayB[])

Raises the first argument to the power of the second argument

Parameters

$dblArrayAthe divident double array
$dblArrayBthe divisor double array

Returns

result as a float array of doubles

mDblMod

#define mel mDblMod(float $dblArrayA[],
int $dblArrayB[])

Returns the floating-point remainder of the division of it arguments A and B

Parameters

$dblArrayAthe divident double array
$dblArrayBthe divisor double array

Returns

floating point remainder as a float array of doubles

mDblTrunc

#define mel mDblTrunc(float[] $dblArrayA)

round value towards zero to the nearest integer

Parameters

$dblArrayAthe double array

Returns

the nearest integers an array of float[]

mDblFrac

#define mel mDblFrac(float[] $dblArrayA)

get fractional part of a dbl

Parameters

$dblArrayAthe double array

Returns

fractional part as an array of float[]

mDblFloor

#define mel mDblFloor(float[] $dblArrayA)

Get largest integral value not greater than value of doubles in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , largest integral value not greater than value of doubles as a float[]

mDblCeil

#define mel mDblCeil(float[] $dblArrayA)

Compute smallest integral value not less than double in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA , the smallest integral values as a float[]

mDblSqrt

#define mel mDblSqrt(float[] $dblArrayA)

Compute square root of double in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA ,the square root values as a float[]

mDblCbrt

Compute cubic root of double in an array

Parameters

$dblArrayAthe double array

Returns

$dblArrayA ,the cubic root values as a float[]

mDblLerp

#define mel mDblLerp(float[] $dblArrayA,
float[] $dblArrayB,
float[] $param)

linear interpolation of two doubles

Parameters

$dblArrayAthe first double array
$dblArrayBthe second double array
$paramthe interpolation parameter [0-1] (will be clamped)

Returns

the interpolated double array as a float array

mDblRound

#define mel mDblRound(float $dblArrayA[],
int $dblArrayB[])

Round mDblArray elements to a specific digit

Parameters

$dblArrayAthe first double array
$intArrayBintArray which defines to which digit after the dot will be rounded, negative numbers will round to the left of the dot

Returns

the rounded dblArray elements as a float[]

mDblClamp

#define mel mDblClamp(float $dblArrayA[],
float $dblArrayMin[],
float $dblArrayMax[])

clamp value between min and max value

Parameters

$dblArrayAthe value to be clamped as a double array
$dblArrayMinthe min value double array
$dblArrayMaxthe max value double array

Returns

the clamped values as a float[]

mDblPulse

#define mel mDblPulse(float $dblArrayA[],
float $dblArrayMin[],
float $dblArrayMax[])

returns 1 if A is between min and max (inclusive) 0 else

Parameters

$dblArrayAthe value to be pulsed
$dblArrayMinthe min value double array
$dblArrayMaxthe max value double array

Returns

the result as a float[]

mDblLinStep

#define mel mDblLinStep(float $dblArrayA[],
float $dblArrayMin[],
float $dblArrayMax[])

Returns value between 0 and 1 representing percentage of the distance between MIN and MAX represented by A.

Parameters

$dblArrayAthe parameter value double array
$dblArrayMinthe min value double array
$dblArrayMaxthe max value double array

Returns

the result as a float[]

mDblFit

#define mel mDblFit(float $dblArrayA[],
float $dblArrayOldMin[],
float $dblArrayOldMax[],
float $dblArrayNewMin[],
float $dblArrayNewMax[])

Returns value between newMin and newMax that isrelative to A in the range between oldMin and oldMax

Parameters

$dblArrayAthe parameter value double array
$dblArrayOldMinthe old min value double array
$dblArrayOldMaxthe old max value double array
$dblArrayNewMinthe new min value double array
$dblArrayNewMaxthe new max value double array

Returns

the result as a float[]

#define mel mDblCreate(int $count,
float $template)
Create a double array
#define mel int mDblSize(float $doubleArrayA[])
Get number of doubles in a double array
#define mel mDblAppend(float $doubleArrayA[],
float $doubleArrayB[])
Append elements to the end of a double array
#define mel mDblGet(float $doubleArrayA[],
int $id[],
float $doubleArrayB[])
Get elements from a double array
#define mel mDblSet(float $doubleArrayA[],
int $id[],
float $doubleArrayB[])
Set elements in a double array, this function will not grow the double array, but error when you try to set an invalid array element!
#define mel mDblAdd(float[] $dblArrayA,
float[] $dblArrayB)
Add two double arrays together elementwise
#define mel mDblSub(float[] $dblArrayA,
float[] $dblArrayB)
Subtract two double arrays elementwise
#define mel mDblMult(float[] $dblArrayA,
float[] $dblArrayB)
Multiply componentwise two double arrays together
#define mel mDblDiv(float[] $dblArrayA,
float[] $dblArrayB)
Division of double and double
#define mel mDblNegate(float[] $dblArrayA)
Negate doubles in an array
#define mel mDblIsEqual(float[] $dblArrayA,
float[] $dblArrayB)
Check if two mDblArray elements are exactly equal
#define mel mDblIsNotEqual(float[] $dblArrayA,
float[] $dblArrayB)
Check if mDblArray elements are not equal
#define mel mDblIsEquivalent(float[] $dblArrayA,
float[] $dblArrayB), float[] $toleranceArray)
Check if elements of two double arrays are equivalent within a tolerance
#define mel mDblMin(float[] $dblArrayA,
float[] $dblArrayB)
return the minimum of the two values
#define mel mDblMax(float[] $dblArrayA,
float[] $dblArrayB)
return the maximum of the two values
#define mel mDblAbs(float[] $dblArrayA)
Get absolute value of doubles in an array
#define mel mDblSign(float[] $dblArrayA)
get the sign of a double, -1 if dbl<0, 0 if dbl=0 and 1 if dbl>0
#define mel mDblDegToRad(float[] $dblArrayA)
Convert degrees to radians
#define mel mDblRadToDeg(float[] $dblArrayA)
Convert radians to degrees
#define mel mDblSin(float[] $dblArrayA)
Get sine value of doubles in an array
#define mel mDblCos(float[] $dblArrayA)
Get cosine value of doubles in an array
#define mel mDblTan(float[] $dblArrayA)
Get tangent value of doubles in an array
#define mel mDblASin(float[] $dblArrayA)
Get arc sine value of doubles in an array
#define mel mDblACos(float[] $dblArrayA)
Get arc cosine value of doubles in an array
#define mel mDblATan(float[] $dblArrayA)
Get arc tangent value of doubles in an array
#define mel mDblHSin(float[] $dblArrayA)
Get hyperbolic sine value of doubles in an array
#define mel mDblHCos(float[] $dblArrayA)
Get hyperbolic cosine value of doubles in an array
#define mel mDblHTan(float[] $dblArrayA)
Get hyperbolic tangent value of doubles in an array
#define mel mDblLog(float[] $dblArrayA)
Get natural logarithm value of doubles in an array
#define mel mDblLog10(float[] $dblArrayA)
Get base 10 logarithm value of doubles in an array
#define mel mDblPow(float $dblArrayA[],
int $dblArrayB[])
Raises the first argument to the power of the second argument
#define mel mDblMod(float $dblArrayA[],
int $dblArrayB[])
Returns the floating-point remainder of the division of it arguments A and B
#define mel mDblTrunc(float[] $dblArrayA)
round value towards zero to the nearest integer
#define mel mDblFrac(float[] $dblArrayA)
get fractional part of a dbl
#define mel mDblFloor(float[] $dblArrayA)
Get largest integral value not greater than value of doubles in an array
#define mel mDblCeil(float[] $dblArrayA)
Compute smallest integral value not less than double in an array
#define mel mDblSqrt(float[] $dblArrayA)
Compute square root of double in an array
#define mel mDblLerp(float[] $dblArrayA,
float[] $dblArrayB,
float[] $param)
linear interpolation of two doubles
#define mel mDblRound(float $dblArrayA[],
int $dblArrayB[])
Round mDblArray elements to a specific digit
#define mel mDblClamp(float $dblArrayA[],
float $dblArrayMin[],
float $dblArrayMax[])
clamp value between min and max value
#define mel mDblPulse(float $dblArrayA[],
float $dblArrayMin[],
float $dblArrayMax[])
returns 1 if A is between min and max (inclusive) 0 else
#define mel mDblLinStep(float $dblArrayA[],
float $dblArrayMin[],
float $dblArrayMax[])
Returns value between 0 and 1 representing percentage of the distance between MIN and MAX represented by A.
#define mel mDblFit(float $dblArrayA[],
float $dblArrayOldMin[],
float $dblArrayOldMax[],
float $dblArrayNewMin[],
float $dblArrayNewMax[])
Returns value between newMin and newMax that isrelative to A in the range between oldMin and oldMax