Mathematical Functions
[Functions]


Functions

matrix abs (matrix M)
 Evaluates the magnitude of the components of a matrix.
list abs (list L)
 Evaluates the magnitude of the components of a list.
scalar abs (multivector A)
 Evaluates the absolute value of the magnitude of a blade.
scalar abs (scalar Val)
 Evaluates the absolute value of the given scalar.
matrix acos (matrix M)
 Evaluates the arcus cosine of the components of a matrix.
list acos (list L)
 Evaluates the arcus cosine of the components of a list.
scalar acos (scalar x)
 Evaluates the arc cosine of an angle.
matrix asin (matrix M)
 Evaluates the arcus sine of the components of a matrix.
list asin (list L)
 Evaluates the arcus sine of the components of a list.
scalar asin (scalar x)
 Evaluates the arc sine of an angle.
matrix atan (matrix M)
 Evaluates the arcus tangens of the components of a matrix.
list atan (list L)
 Evaluates the arcus tangens of the components of a list.
scalar atan (scalar x)
 Evaluates the arc tangent of an angle.
list ceil (list L)
 Evaluates the ceiling of the components of a list.
scalar ceil (multivector A)
 Evaluates the smallest integer value that is larger or equal to the given value for each element of a multivector.
scalar ceil (scalar x)
 Evaluates the smallest integer value that is larger or equal to the given value.
matrix cos (matrix M)
 Evaluates the cosine of the components of a matrix.
list cos (list L)
 Evaluates the cosine of the components of a list.
scalar cos (scalar Rad)
 Evaluates the cosine of the given angle.
matrix exp (matrix M)
 Evaluates the exponential of the components of a matrix.
list exp (list L)
 Evaluates the exponential of the components of a list.
multivector exp (multivector A)
 Approximates the exponential of a multivector.
scalar exp (scalar x)
 Evaluates the exponential of a value.
scalar fact (counter n)
 Evaluates the factorial of an integer number.
list floor (list L)
 Evaluates the floor of the components of a list.
scalar floor (multivector A)
 Evaluates the largest integer value that is smaller or equal to the given value for each component of the multivector A.
scalar floor (scalar x)
 Evaluates the largest integer value that is smaller or equal to the given value.
matrix inv (matrix M)
 Inverts all nonzero components of a matrix separately.
list iprod (list L)
 Evaluates the inner product of a list.
matrix log (matrix M)
 Evaluates the natural logarithm of the components of a matrix.
list log (list L)
 Evaluates the natural logarithm of the components of a list.
scalar log (scalar x)
 Evaluates the natural logarithm of a value.
list oprod (list L)
 Evaluates the outer product of a list.
matrix pow (matrix M, scalar a)
 Raises the components of a matrix to a given power.
scalar pow (list L, scalar a)
 Evaluates all values in a list raised to a particular power.
multivector pow (multivector A, counter n)
 Evaluates a multivector raised to an integer power.
scalar pow (scalar x, scalar a)
 Evaluates a value raised to a particular power.
list prod (matrix M)
 Evaluates the product of every row for a given matrix.
list prod (list L)
 Evaluates the product of a list.
list round (list X, counter prec)
 Rounds the components of a list to the given precision.
matrix round (matrix X, counter prec)
 Rounds the components of a matrix to the given precision.
mutlivector round (multivector X, counter prec)
 Rounds the components of a multivector to the given precision.
scalar round (scalar X, counter prec)
 Rounds a scalar to the given precision.
scalar sign (scalar dA)
 Evaluates the sign of a scalar.
matrix sin (matrix M)
 Evaluates the sine of the components of a matrix.
list sin (list L)
 Evaluates the sine of the components of a list.
scalar sin (scalar rad)
 Evaluates the sine of an angle.
matrix sqrt (matrix M)
 Evaluates the square root of the components of a matrix.
list sqrt (list L)
 Evaluates the square root of the components of a list.
scalar sqrt (scalar x)
 Evaluates the square root of a value.
matrix sub (matrix M)
 Evaluates the difference of the row elements of a matrix.
list sub (list L)
 Evaluates the difference of the elements of a list.
matrix sum (matrix M)
 Evaluates the sum of every row for a given matrix.
list sum (list L)
 Evaluates the sum of a list.
matrix tan (matrix M)
 Evaluates the tangent of the components of a matrix.
list tan (list L)
 Evaluates the tangent of the components of a list.
scalar tan (scalar rad)
 Evaluates the tangent of an angle.

Detailed Description

These are mathematical functions.

Function Documentation

matrix abs matrix  M  ) 
 

Evaluates the magnitude of the components of a matrix.

Parameters:
M The matrix of whose components the magnitude is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list abs list  L  ) 
 

Evaluates the magnitude of the components of a list.

Parameters:
L The list of whose components the magnitude is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar abs multivector  A  ) 
 

Evaluates the absolute value of the magnitude of a blade.

Parameters:
A Multivector (blade) of which absolute magnitude is to be evaluated.
Returns:
The absolute magnitude value.
Since:
v1.0
The magnitude of the multivector A is evaluated via the formula $ \sqrt{|A\cdot \tilde{A}|} $ .

scalar abs scalar  Val  ) 
 

Evaluates the absolute value of the given scalar.

Parameters:
Val Value of which absolute (magnitude) is to be evaluated.
Returns:
The absolute value.
Since:
v1.0

matrix acos matrix  M  ) 
 

Evaluates the arcus cosine of the components of a matrix.

Parameters:
M The matrix of whose components the arcus cosine is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list acos list  L  ) 
 

Evaluates the arcus cosine of the components of a list.

Parameters:
L The list of whose components the arcus cosine is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar acos scalar  x  ) 
 

Evaluates the arc cosine of an angle.

Parameters:
x The value between -1 and 1 of which the arc cosine is to be evaluated.
Returns:
The value $ \cos^{-1}(x) $ .
Since:
v1.0

matrix asin matrix  M  ) 
 

Evaluates the arcus sine of the components of a matrix.

Parameters:
M The matrix of whose components the arcus sine is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list asin list  L  ) 
 

Evaluates the arcus sine of the components of a list.

Parameters:
L The list of whose components the arcus sine is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar asin scalar  x  ) 
 

Evaluates the arc sine of an angle.

Parameters:
x The value between -1 and 1 of which the arc sine is to be evaluated.
Returns:
The value $ \sin^{-1}(x) $ .
Since:
v1.0

matrix atan matrix  M  ) 
 

Evaluates the arcus tangens of the components of a matrix.

Parameters:
M The matrix of whose components the arcus tangens is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list atan list  L  ) 
 

Evaluates the arcus tangens of the components of a list.

Parameters:
L The list of whose components the arcus tangens is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar atan scalar  x  ) 
 

Evaluates the arc tangent of an angle.

Parameters:
x The value between -1 and 1 of which the arc tangent is to be evaluated.
Returns:
The value $ \tan^{-1}(x) $ .
Since:
v1.0

list ceil list  L  ) 
 

Evaluates the ceiling of the components of a list.

Parameters:
L The list of whose components the ceiling is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar ceil multivector  A  ) 
 

Evaluates the smallest integer value that is larger or equal to the given value for each element of a multivector.

Parameters:
A The multivector.
Returns:
The adjusted multivector.
Since:
v2.1

scalar ceil scalar  x  ) 
 

Evaluates the smallest integer value that is larger or equal to the given value.

Parameters:
x The scalar value.
Returns:
The smallest integer value $ n $ with $ n\ge x $ .
Since:
v1.0

matrix cos matrix  M  ) 
 

Evaluates the cosine of the components of a matrix.

Parameters:
M The matrix of whose components the cosine is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list cos list  L  ) 
 

Evaluates the cosine of the components of a list.

Parameters:
L The list of whose components the cosine is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar cos scalar  Rad  ) 
 

Evaluates the cosine of the given angle.

Parameters:
Rad Angle in Radians.
Returns:
The cosine of the angle Rad.
Since:
v1.0

matrix exp matrix  M  ) 
 

Evaluates the exponential of the components of a matrix.

Parameters:
M The matrix of whose components the exponential is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list exp list  L  ) 
 

Evaluates the exponential of the components of a list.

Parameters:
L The list of whose components the exponential is to be taken.
Returns:
The resultant list.
Since:
v2.0

multivector exp multivector  A  ) 
 

Approximates the exponential of a multivector.

Parameters:
A The multivector.
Returns:
The approximated exponential of A.
Since:
v1.0
The exponential is approximated by evaluating the taylor series of the exponential of a multivector up to order 12. For multivectors of small magnitude this may produce large errors!

scalar exp scalar  x  ) 
 

Evaluates the exponential of a value.

Parameters:
x The scalar value.
Returns:
The exponential of x, i.e. $ \exp(x) $ .
Since:
v1.0

scalar fact counter  n  ) 
 

Evaluates the factorial of an integer number.

Parameters:
n The value of which the factorial is to be taken.
Returns:
The value $ !n $ .
Since:
v1.0
The value of x has be an element of $ \{0, 1, \ldots, 170\} $ .

For example,

    
    ?fact(170);

produces the output,

    
    Constant = 7.25742e+306

list floor list  L  ) 
 

Evaluates the floor of the components of a list.

Parameters:
L The list of whose components the floor is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar floor multivector  A  ) 
 

Evaluates the largest integer value that is smaller or equal to the given value for each component of the multivector A.

Parameters:
A The multivector.
Returns:
The adjusted multivector.
Since:
v2.1

scalar floor scalar  x  ) 
 

Evaluates the largest integer value that is smaller or equal to the given value.

Parameters:
x The scalar value.
Returns:
The largest integer value $ n $ with $ n\le x $ .
Since:
v1.0

matrix inv matrix  M  ) 
 

Inverts all nonzero components of a matrix separately.

Parameters:
M A matrix.
Returns:
A matrix with entries $ a_{ij}^{-1} $ iff $ a_{ij}\neq 0$ .
Since:
v2.0
For example,
? M = inv( Matrix( [[5,0], [0,2]] ));

produces the output

M = (| 0.2 0|, | 0 0.5|)

list iprod list  L  ) 
 

Evaluates the inner product of a list.

Parameters:
L A (nested) list of multivectors.
Returns:
A list in which each elementary sublist is replaced by the inner product of its elements.
Since:
v2.1
The evaluation of the inner product of an elementary sublist is simply defined as the inner product of all contributing multivectors. The expression P = iprod([e1,e1]) is for example equal to P = e1.e1;.

matrix log matrix  M  ) 
 

Evaluates the natural logarithm of the components of a matrix.

Parameters:
M The matrix of whose components the natural logarithm is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list log list  L  ) 
 

Evaluates the natural logarithm of the components of a list.

Parameters:
L The list of whose components the natural logarithm is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar log scalar  x  ) 
 

Evaluates the natural logarithm of a value.

Parameters:
x The scalar value.
Returns:
The natural logarithm of x, i.e. $ \log_e(x) $ .
Since:
v1.0

list oprod list  L  ) 
 

Evaluates the outer product of a list.

Parameters:
L A (nested) list of multivectors.
Returns:
A list in which each elementary sublist is replaced by the outer product of its elements.
Since:
v2.1
The evaluation of the outer product of an elementary sublist is simply defined as the outer product of all contributing multivectors. The expression P = oprod([e1,e2,e3]) is for example equal to P = e1^e2^e3;.

matrix pow matrix  M,
scalar  a
 

Raises the components of a matrix to a given power.

Parameters:
M The matrix whose components are to be raised to the power of a.
a The power.
Returns:
The resultant matrix.
Since:
v2.0
Note that pow(M,a) is equivalent to M^^a, in CLUScript v2.2 and higher.

scalar pow list  L,
scalar  a
 

Evaluates all values in a list raised to a particular power.

Parameters:
L The list of values that are to be raised to the power of a.
a The power.
Returns:
A list of the results.
Since:
v1.0
This function basically applies one of the other versions of the pow function to each element of the list. This also works for nested lists. For example,

    
    DefVarsE3();

    ?L = (2, e1^e2, (3, 4));
    ?pow(L, 2);

produces the output

    
    L = (2, [ 1^e12 ], (3, 4))
    Constant = (4, [ -1 ], (9, 16))

Note that pow(L,2) is equivalent to L^^2, in CLUScript v2.2 and higher.

multivector pow multivector  A,
counter  n
 

Evaluates a multivector raised to an integer power.

Parameters:
A the multivector to be raised to the power of n.
n An integer number.
Returns:
The value $ A^n $ .
Since:
v1.0
This function simply evaluates n times the geometric product of A. Note that pow(A,n) is equivalent to A^^n, in CLUScript v2.2 and higher.

scalar pow scalar  x,
scalar  a
 

Evaluates a value raised to a particular power.

Parameters:
x The value that is to be raised to the power of a.
a The power.
Returns:
The value $ x^a $ .
Since:
v1.0
Note that pow(a,b) is equivalent to a^^b, in CLUScript v2.2 and higher.

list prod matrix  M  ) 
 

Evaluates the product of every row for a given matrix.

Parameters:
M A matrix.
Returns:
A list of products.
Since:
v2.0
This function evaluates the products of the matrix rows. Each product is determined through the multiplication of all values within the corresponding matrix row.

list prod list  L  ) 
 

Evaluates the product of a list.

Parameters:
L A (nested) list of scalars, multivectors or matrices.
Returns:
A list in which each elementary sublist is replaced by it's product.
Since:
v2.0
The evaluation of the product of an elementary sublist is simply defined as the product of all contributing scalars. The expression P = prod([1,2,3,4]) is for example equal to P = fact(4);. This function is subject to the same restrictions as the function sum.

list round list  X,
counter  prec
 

Rounds the components of a list to the given precision.

Parameters:
X A list.
prec The precision.
Returns:
The rounded list.
Since:
v2.1
This function applies the function round() for scalars to all components of the list.

matrix round matrix  X,
counter  prec
 

Rounds the components of a matrix to the given precision.

Parameters:
X A matrix.
prec The precision.
Returns:
The rounded matrix.
Since:
v2.1
This function applies the function round() for scalars to all components of the matrix.

mutlivector round multivector  X,
counter  prec
 

Rounds the components of a multivector to the given precision.

Parameters:
X A multivector.
prec The precision.
Returns:
The rounded multivector.
Since:
v2.1
This function applies the function round() for scalars to all components of the multivector.

scalar round scalar  X,
counter  prec
 

Rounds a scalar to the given precision.

Parameters:
X A scalar.
prec The precision.
Returns:
The rounded scalar.
Since:
v2.1
This function rounds a scalar to the given precision. That is, the returned scalar will have at most prec digits behind the decimal point, if prec is positive. If prec is negative, this function rounds by prec digits before the decimal point.

Here is an example.

    SetTextPrec(12);
    ?round(1.2344, 3);
    ?round(1.2345, 3);
    ?round(1.2345, 4);

This results in

Constant = 1.234
Constant = 1.235
Constant = 1.2345

scalar sign scalar  dA  ) 
 

Evaluates the sign of a scalar.

Parameters:
dA The scalar.
Returns:
The sign of dA.

matrix sin matrix  M  ) 
 

Evaluates the sine of the components of a matrix.

Parameters:
M The matrix of whose components the sine is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list sin list  L  ) 
 

Evaluates the sine of the components of a list.

Parameters:
L The list of whose components the sine is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar sin scalar  rad  ) 
 

Evaluates the sine of an angle.

Parameters:
rad The angle in radians of which the sine is to be evaluated.
Returns:
The value $ \sin(rad) $ .
Since:
v1.0

matrix sqrt matrix  M  ) 
 

Evaluates the square root of the components of a matrix.

Parameters:
M The matrix of whose components the square root is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list sqrt list  L  ) 
 

Evaluates the square root of the components of a list.

Parameters:
L The list of whose components the square root is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar sqrt scalar  x  ) 
 

Evaluates the square root of a value.

Parameters:
x The value of which the square root is to be taken.
Returns:
The value $ \sqrt{x} $ .
Since:
v1.0

matrix sub matrix  M  ) 
 

Evaluates the difference of the row elements of a matrix.

Parameters:
M A matrix.
Returns:
A matrix in which each row of the initial matrix is replaced by the first element of each row minus the sum of the rest in the respective row.
Since:
v2.1
Here is a simple example.

    ?sub(Matrix([[1,2],[2,3]]));

This results in the following.

Constant <font size="12">(2x1)</font> = <font size="12">
-1
-1
.
</font>

list sub list  L  ) 
 

Evaluates the difference of the elements of a list.

Parameters:
L A (nested) list of object that can be subtracted.
Returns:
A list in which each elementary sublist is replaced by the first element minus the sum of the rest.
Since:
v2.1
Attention:
If list L is an elementary list, i.e. L doesn't containt any sublists, then the return will be a scalar.

matrix sum matrix  M  ) 
 

Evaluates the sum of every row for a given matrix.

Parameters:
M A matrix.
Returns:
A column vector of row sums.
Since:
v2.0
This function evaluates the sums of the matrix rows. Here's an example,

    ?M = Matrix( [ [10, 2, 3, 13], [5, 11, 2, 8], [9, 7, 6, 1], [4, 14, 5, 1] ] );
    ?S = sum(M);    
The output will then be

M = <font size="12">
102313
51128
9761
41451
</font>
S = <font size="12">
28
26
23
24
</font>

list sum list  L  ) 
 

Evaluates the sum of a list.

Parameters:
L A (nested) list of scalars.
Returns:
A list in which each elementary sublist is replaced by it's sum.
Since:
v2.0
Attention:
If list L is an elementary list, i.e. L doesn't containt any sublists, then the return will be a scalar.
In the subsequent example it can be seen that this operation retains the structure of a nested list. Note that a list can be regarded as a tree where the scalars represent the leaves. A list can therefore be denoted as 'regular', if each scalar has the same depth within the associated tree. Thus a list should be regular to perform the summation via function sum. The following code also gives two brief counter-examples.
    ? L = [ [ [1],[2,2],[3,3,3] ],[ 1,2,3,4,5 ] ];
    ? S = sum( L );
    // Error = sum( S );
    // Error = sum( [ [1, [2,3] ],[ 4,5 ] ] );

which yields

    L = [[[1], [2, 2], [3, 3, 3]], [1, 2, 3, 4, 5]]
    S = [[1, 4, 9], 15]

matrix tan matrix  M  ) 
 

Evaluates the tangent of the components of a matrix.

Parameters:
M The matrix of whose components the tangent is to be taken.
Returns:
The resultant matrix.
Since:
v2.0

list tan list  L  ) 
 

Evaluates the tangent of the components of a list.

Parameters:
L The list of whose components the tangent is to be taken.
Returns:
The resultant list.
Since:
v2.0

scalar tan scalar  rad  ) 
 

Evaluates the tangent of an angle.

Parameters:
rad The angle in radians of which the tangent is to be evaluated.
Returns:
The value $ \tan(rad) $ .
Since:
v1.0