Geometric Algebra Functions
[Functions]


Functions

multivector acp (multivector X, multivector Y)
 Evaluates the anti-commutator product of X and Y.
multivector AffineVecP3 (list L)
 Projects a list of homogeneous vectors in projective space to the affine plane.
multivector AffineVecP3 (multivector A)
 Projects a homogeneous vector in projective space to the affine plane.
list AnalyzeMV (multivector X, counter DoDraw)
 Returns data concerning the geometric representaion of actual multivector.
list BladeIdxList (multivector X)
 Get the indices of the basisblades which build up the multivector X.
multivector cp (multivector X, multivector Y)
 Evaluates the commutator product of X and Y.
void DefVarsC2 ()
 Defines a set of variables for basis vectors of 2D-conic space.
void DefVarsE3 ()
 Defines a set of variables for basis vectors of Euclidean space.
void DefVarsN3 ()
 Defines a set of variables for basis vectors of conformals space.
void DefVarsP3 ()
 Defines a set of variables for basis vectors of conformals space.
list DegConic (multivector conic)
 Makes a given projective conic degenerate.
multivector DilatorN3 (scalar scale)
 Creates a dilation operator for conformal space.
multivector DirVecN3 (scalar x, scalar y, scalar z)
 Creates a "direction" vector in conformal space.
multivector DirVecP3 (scalar x, scalar y, scalar z)
 Creates a "direction" vector in projective space.
multivector FactorizeBlade (multivector A)
 Factorizes a blade into its constituent vectors.
list FindAllDegConics (multivector A, multivector B)
 Evaluates all degenerate conics that can be generated through the linear combination of two given conics.
list GradeList (multivector A)
 Gives the list of grades contained in a multivector.
list MV2Mask (multivector X)
 Generates a mask from a multivector X for use in e.g. GetMVProductMatrix.
multivector proj (multivector X, multivector A)
 Evaluates the projection of X on A.
multivector ReflectorC2 (scalar angle)
 Creates a reflector. In conic space this is a multivector of mixed grades zero and two.
multivector rej (multivector X, multivector A)
 Evaluates the rejection of X from A.
multivector RotorC2 (scalar angle)
 Creates a rotor, i.e. multivector of mixed grades zero, two and four, in 2D-conic space.
multivector RotorE3 (multivector U, scalar angle)
 Creates a rotor, i.e. multivector of mixed grades zero and two, in Euclidean space.
multivector RotorE3 (scalar x, scalar y, scalar z, scalar angle)
 Creates a rotor, i.e. multivector of mixed grades zero and two, in Euclidean space.
multivector RotorN3 (multivector U, scalar angle)
 Creates a rotor, i.e. multivector of mixed grades zero and two, in conformal space.
multivector RotorN3 (scalar x, scalar y, scalar z, scalar angle)
 Creates a rotor, i.e. multivector of mixed grades zero and two, in conformal space.
multivector RotorP3 (multivector U, scalar angle)
 Creates a rotor, i.e. multivector of mixed grades zero and two, in projective space.
multivector RotorP3 (scalar x, scalar y, scalar z, scalar angle)
 Creates a rotor, i.e. multivector of mixed grades zero and two, in projective space.
counter Size (multivector M)
 Returns the algebra dimension of a multivector.
multivector SphereN3 (scalar x, scalar y, scalar z, scalar radius)
 Creates a multivector of grade four representing a sphere in Euclidean space.
multivector SphereN3 (multivector center, scalar radius)
 Creates a multivector of grade four representing a sphere in Euclidean space.
multivector TranslatorN3 (scalar x, scalar y, scalar z)
 Creates a multivector that acts as a translation operator in conformal space.
multivector VecC2 (matrix M)
 Creates a vector, i.e. multivector of grade one, in 2D-conic space, which is the embedding of the given symmetric 3 by 3 matrix.
multivector VecC2 (multivector A)
 Creates a vector, i.e. multivector of grade one, in 2D-conic space.
multivector VecC2 (counter mode)
 Creates a vector, i.e. multivector of grade one, in 2D-conic space, which is directly user controllable.
multivector VecC2 (scalar x, scalar y)
 Creates a vector, i.e. multivector of grade one, in 2D-conic space.
multivector VecE3 (multivector A)
 Creates a vector, i.e. multivector of grade one, in Euclidean space.
multivector VecE3 (counter mode)
 Creates a vector, i.e. multivector of grade one, in Euclidean space, which is directly user controllable.
multivector VecE3 (scalar x, scalar y, scalar z)
 Creates a vector, i.e. multivector of grade one, in Euclidean space.
multivector VecN3 (multivector A)
 Creates a vector, i.e. multivector of grade one, in conformal space.
multivector VecN3 (counter mode)
 Creates a vector, i.e. multivector of grade one, in conformal space, which is directly user controllable.
multivector VecN3 (scalar x, scalar y, scalar z)
 Creates a vector, i.e. multivector of grade one, in conformal space.
multivector VecP3 (multivector A)
 Creates a vector, i.e. multivector of grade one, in projective space.
multivector VecP3 (counter mode)
 Creates a vector, i.e. multivector of grade one, in projective space, which is directly user controllable.
multivector VecP3 (scalar x, scalar y, scalar z)
 Creates a vector, i.e. multivector of grade one, in projective space.

Detailed Description

Functions that create and evaluate operations between multivectors.

Function Documentation

multivector acp multivector  X,
multivector  Y
 

Evaluates the anti-commutator product of X and Y.

Parameters:
X A multivector.
Y A multivector.
Returns:
The anti-commutator product of X and Y, i.e. $ \frac{1}{2}\;(X Y + Y X) $ .
Since:
v1.0

multivector AffineVecP3 list  L  ) 
 

Projects a list of homogeneous vectors in projective space to the affine plane.

Parameters:
L A list of homogeneous vectors, i.e. multivectors of grade one in projective space.
Returns:
The list of projections of the elements of L onto the affine plane.
Since:
v1.0
Given a vector $A$ in projective space with $A = \mathbf{a} + \rho e_4$ , where $\mathbf{a} = x\,e_1 + y\,e_2 + z\,e_3$ and $\rho$ a real number, this function returns the vector $\frac{1}{\rho} A = \frac{1}{\rho}\mathbf{a} + e_4$ .

multivector AffineVecP3 multivector  A  ) 
 

Projects a homogeneous vector in projective space to the affine plane.

Parameters:
A A homogeneous vector, i.e. a multivector of grade one in projective space.
Returns:
The projection of A onto the affine plane.
Since:
v1.0
Given a vector $A$ in projective space with $A = \mathbf{a} + \rho e_4$ , where $\mathbf{a} = x\,e_1 + y\,e_2 + z\,e_3$ and $\rho$ a real number, this function returns the vector $\frac{1}{\rho} A = \frac{1}{\rho}\mathbf{a} + e_4$ .

list AnalyzeMV multivector  X,
counter  DoDraw
 

Returns data concerning the geometric representaion of actual multivector.

Parameters:
X A multivector.
DoDraw (optional) A boolean flag indicating whether the entity to analyze is to be drawn or not (default).
Returns:
A nested list of data obtained from multivector X. The output also depends on the choosen nullspace (IPNS or OPNS).
Since:
v2.0
The application to a multivector representing a pointpair results e.g. in the output
    
    C = [point_pair, [mag, 2.06155], [pos1, [ -2^e1 + 1^e3 ]], [pos2, [ 1^e1 + 2^e2 + 3^e3 ]]]

Note that each piece of information can be extracted by using list operations. Recreate for example the above point pair in the conformal space by the expression

    PP = VecN3( C(3,2) ) ^ VecN3( C(4,2) );
For more information according to list operations see section Variable Lists.

list BladeIdxList multivector  X  ) 
 

Get the indices of the basisblades which build up the multivector X.

Parameters:
X A multivector.
Returns:
An ascending list of indices which build up the multivector X.
Since:
v2.0
    DefVarsN3();
    
    A = 3*e1^e2 + I - 2*e3 + 1;
    B = e1 + e2 + e3 + ep + em;
    ? L = BladeIdxList( A );
    ? BladeIdxList( B );

produces the output

    
    L = [1, 4, 9, 32]
    IndexList = [2, 3, 4, 5, 6] 

multivector cp multivector  X,
multivector  Y
 

Evaluates the commutator product of X and Y.

Parameters:
X A multivector.
Y A multivector.
Returns:
The commutator product of X and Y, i.e. $ \frac{1}{2}\;(X Y - Y X) $ .
Since:
v1.0

void DefVarsC2  ) 
 

Defines a set of variables for basis vectors of 2D-conic space.

Returns:
Nothing.
Since:
v2.0
The following variables are defined.
Function Variable Content
DefVarsC2() id 1
e1 $e_1$
e2 $e_2$
e3 $e_3$
e4 $e_4$
e5 $e_5$
e6 $e_6$
I $e_1\wedge e_2\wedge e_3\wedge e_4\wedge e_5\wedge e_6$

The six basis vectors of conic space $\{ e_1, e_2, e_3, e_4, e_5, e_6 \}$ all square to $+1$ . Vectors in this space basically encode symmetric 3 by 3 matrices. Details on the embedding can be found in the technical report "Analysis of Local Image Structure using Intersections of Conics" (download). Given a symmetric 3 by 3 matrix it can be embedded in conic space by passing it through the function VecC2(). The opposite is also possible, by passing a vector in conic space to the function Matrix(). See section Working with Multivectors for more details.

void DefVarsE3  ) 
 

Defines a set of variables for basis vectors of Euclidean space.

Returns:
Nothing.
Since:
v1.0
The following variables are defined.
Variable Content
id 1
e1 $e_1$
e2 $e_2$
e3 $e_3$
I $e_1\wedge e_2\wedge e_3$

The three basis vectors of Euclidean space $\{ e_1, e_2, e_3 \}$ all square to $+1$ . The variable id is defined in order to create grade zero multivectors in Euclidean space. See section Working with Multivectors for more details.

void DefVarsN3  ) 
 

Defines a set of variables for basis vectors of conformals space.

Returns:
Nothing.
Since:
v1.0
The following basis vectors are defined.
Variable Content
id 1
e1 $e_1$
e2 $e_2$
e3 $e_3$
ep $e_+$
em $e_-$
e $e$
e0 $e_0$
n $n$
nb $e_0$
I $e_1\wedge e_2\wedge e_3\wedge e_+\wedge e_-$

In conformal space the four basis vectors $\{ e_1, e_2, e_3, e_+ \}$ square to $+1$ and $e_-$ squares to $-1$ . The composite elements $e, e_0, n, e_0$ are defined as

\[ e \equiv n := e_- + e_+\;;\quad e_0 \equiv e_0 := \frac{1}{2} (e_- - e_+) \]

The pairs $\{ e, e_0 \}$ and $\{ n, \bar{n} \}$ are complementary null vectors. That is, $e^2 = e_0^2 = n^2 = e_0^2 = 0$ and $e\cdot e_0 = n\cdot \bar{n} = -1$ . The two naming conventions for these null vector pairs are used by different researchers. Here both are defined so that nobody gets confused. See section Working with Multivectors for more details.

void DefVarsP3  ) 
 

Defines a set of variables for basis vectors of conformals space.

Returns:
Nothing.
Since:
v1.0
Variable Content
id 1
e1 $e_1$
e2 $e_2$
e3 $e_3$
e4 $e_4$
I $e_1\wedge e_2\wedge e_3\wedge e_4$

The four basis vectors of projective space $\{ e_1, e_2, e_3, e_4 \}$ all square to $+1$ . Note that this differs from some researchers which prefer to use a space-time basis for projective space, i.e. $\{ e_1, e_2, e_3 \}$ square to $-1$ and $e_4$ squares to $+1$ . The variable id is defined in order to create grade zero multivectors in projective space. See section Working with Multivectors for more details.

list DegConic multivector  conic  ) 
 

Makes a given projective conic degenerate.

Parameters:
conic The conic to be made degenerate.
Returns:
A list containing as first element the degenerate conic and as second element a distance value of the degenerate conic to the initial conic.
Since:
v2.0
This function can be useful for hyperbolas, since the corresponding degenerate conic gives the asymptotes of the hyperbola. For example, if you pass a multivector representing a hyperbola centered on the origin with the matrix representation

\[ \left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{array} \right) \]

then this function returns a multivector with the matrix representation

\[ \left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 0 \end{array} \right) \]

The script

    // The switch IPNS is important here,
    // since DegConic interprets the multivector
    // passed to it with respect to this setting.
    :IPNS; 
    ?M = Matrix( [[1,0,0], [0,-1,0], [0,0,-1]] );
    :C = VecC2(M);
    ?lCd = DegConic(C);
    
    ?"Distance to conic: " + lCd(2);
    
    ?Md = Matrix(lCd(1));
produces the output
    M = (| 1 0 0|, | 0 -1 0|, | 0 0 -1|)
    lCd = [[ 0.707107^e4 + -0.707107^e5 ], 1]
    Distance to conic: 1
    Md = (| 1 0 0|, | 0 -1 0|, | 0 0 0|)

multivector DilatorN3 scalar  scale  ) 
 

Creates a dilation operator for conformal space.

Parameters:
scale The scale by which the dilation operator scales.
Returns:
Dilation operator.
Since:
v1.0
A dilation operator cannot be visualized. For example, a rotation about the y-axis by an angle of $\pi/4$ of any multivector may be done as follows:
    :A = VecN3(1,1,1):Red;
    D = DilatorN3(2);
    :B = D * A * ~D:Green;
    ?A;
    ?B;

This script has the following output:

     
    A = 1^e1 + 1^e2 + 1^e3 + 1.5^e + 1^e0
    B = 2^e1 + 2^e2 + 2^e3 + 6^e + 1^e0

multivector DirVecN3 scalar  x,
scalar  y,
scalar  z
 

Creates a "direction" vector in conformal space.

Parameters:
x x-component of direction.
y y-component of direction.
z z-component of direction.
Returns:
The direction vector (x, y, z) in conformal space.
Since:
v1.0
By direction vector a vector of the type $x\,e_1 + y\,e_2 + z\,e_3$ is meant. For example,
    
    ?A = DirVecN3(1,1,1);

produces the output

    
    A = 1^e1 + 1^e2 + 1^e3;

multivector DirVecP3 scalar  x,
scalar  y,
scalar  z
 

Creates a "direction" vector in projective space.

Parameters:
x x-component of direction.
y y-component of direction.
z z-component of direction.
Returns:
The direction vector (x, y, z) in projective space.
Since:
v1.0
By direction vector a vector of the type $x\,e_1 + y\,e_2 + z\,e_3$ is meant. For example,
    
    ?A = DirVecP3(1,1,1);

produces the output

    
    A = 1^e1 + 1^e2 + 1^e3;

multivector FactorizeBlade multivector  A  ) 
 

Factorizes a blade into its constituent vectors.

Parameters:
A The blade to be factorized.
Returns:
A list of the constituent vectors.
Since:
v1.0
Attention:
Form version 1.5 onwards, this function can factorize also null blades, i.e. blades that square to zero.
The factorization works only for blades and the resulting vectors are normalized. This implies that the scaling of the original blade is lost. If a multivector that contains elements of a number of different grades is passed to this function, the homogeneous multivector of highest grade is used for the factorization. However, even though this need not be a blade in general, there is no additional transformation to the "nearest" blade, yet. If the function is applied to an element which is not a blade, the factorization will simply be wrong.

Here is an example for a standard blade.

    
    DefVarsE3();
    
    // The initial balde
    ?a = (e1 - e3) ^ e2;
    
    // Factorize the blade a
    ?L = FactorizeBlade(a);
    
    // Extract the factorized vectors from the list
    ?L1 = L[1];
    ?L2 = L[2];
    
    // Their outer product gives the initial blade
    // up to a scalar factor
    ?L1 ^ L2;

produces the output

    
    a = 1^e23 + 1^e12
    L = ([ 1^e2 ], [ -0.707107^e1 + 0.707107^e3 ])
    L1 = 1^e2
    L2 = -0.707^e1 + 0.707^e3
    Constant = 0.707^e23 + 0.707^e12

In conformal space there exist also null blades, i.e. blades that square to zero. These cannot be factorized with the standard factorization algorithm. The algorithm implement here therefore first removes the null component from the blade and then factorizes the rest in the standard way. Here is an example,

    
    DefVarsN3();
    
    // The initial blade
    ?a = (e1 + e2) ^ e3 ^ e;
    
    // Factorize the blade 'a'
    ?L = FactorizeBlade(a);
    
    // Extract the factorized vectors from the list
    ?L1 = L[1];
    ?L2 = L[2];
    ?L2 = L[3];
    
    // Their outer product gives the initial blade
    // up to a scalar factor
    ?L1 ^ L2 ^ L3;

This script produces the following output,

    a = 1^(e23^e) + -1^(e31^e)
    L = ([ -1^e+ + -1^e- ], [ 1^e3 ], [ 0.707107^e1 + 0.707107^e2 ])
    L1 = -1^e
    L2 = 1^e3
    L3 = 0.707^e1 + 0.707^e2
    Constant = 0.707^(e23^e) + -0.707^(e31^e)

Note that the factorization of a null blade returns as first element always the null vector component.

list FindAllDegConics multivector  A,
multivector  B
 

Evaluates all degenerate conics that can be generated through the linear combination of two given conics.

Parameters:
A The first conic.
B The second conic.
Returns:
The list of degenerate conics. There will be either one or three degenerate conics returned.
Since:
v2.1
Given two conics as multivectors, this function evaluates all degenerate conics that can be generated through linear combinations of the two. It can be shown that there exist either one or three such degenerate conics. Note that this function is actually used internally in order to find the intersections of two conics. Here is an example.

    
    _2dView = 1;
    :DRAW_POINT_AS_SPHERE;

    :Red;
    :A = VecC2(-1,0)^VecC2(0,1)^VecC2(1,0)^VecC2(0,-1)^VecC2(1,1);

    :Blue;
    :B = VecC2(-1,0)^VecC2(0,1)^VecC2(1,0)^VecC2(0,-1)^VecC2(-0.5,0.1);

    :Green;
    :A & B; // The intersections of the two conics

    ?lC = FindAllDegConics(A, B);

    :lC(1) :Magenta;
    :lC(2) :Cyan;
    :lC(3) :Yellow;

This generates the following visualization.

ConicDegEx1.jpg

list GradeList multivector  A  ) 
 

Gives the list of grades contained in a multivector.

Parameters:
A The multivector to be analyzed.
Returns:
The list of grades contained in A in descending order.
Since:
v1.0
The function returns a list containing the vector grades that are contained in the multivector A in descending order.

    
    DefVarsE3();
    
    ?X = 1 + e1 + e2 + e1^e2 + I;
    ?L = GradeList(X);

produces the output

    
    X = 1 + 1^e1 + 1^e2 + 1^e12 + 1^I
    L = (3, 2, 1, 0)

list MV2Mask multivector  X  ) 
 

Generates a mask from a multivector X for use in e.g. GetMVProductMatrix.

Parameters:
X A multivector.
Returns:
A list of length $k$ of numbers, where $k$ is the dimension ($2^n$ ) of the actual algebra. Each nonzero component of multivector X corresponds to an entry in that list. _2d The numbers within the list are an ascending enumeration according to the predefined order of basisblades. This function is not to be confused with BladeIdxList, which just gives the indices to the numbers.
Since:
v2.0
    DefVarsN3(); // --> 32 basisblades
    
    X = 5*e1^e2 + I - 7*e3 + 8;
    ? L1 = BladeIdxList( X );
    ? L2 = MV2Mask( X );

produces the output

    
    L1 = [1, 4, 9, 32]
    L2 = [1, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4]

multivector proj multivector  X,
multivector  A
 

Evaluates the projection of X on A.

Parameters:
X The blade to be projected.
A The blade on which X is to be projected.
Returns:
The blade component of X that lies in A.
Since:
v1.0

multivector ReflectorC2 scalar  angle  ) 
 

Creates a reflector. In conic space this is a multivector of mixed grades zero and two.

Parameters:
angle of reflection vector to x-axis in radians.
Returns:
Reflector operator in 2D-conic space.
Since:
v2.0
For example, a reflection of any multivector may be done as follows:
    R = ReflectorC2(Slider("fac", 0, 2, 0.05, 0) *Pi);
    
    :Red;
    // A hyperbola in the OPNS
    :x = *VecC2(Matrix( [[1,0,0], [0,-2,0], [0,0,-1]] ));
    
    :Blue;
    // The rotated hyperbola
    :y = R * x * ~R;

multivector rej multivector  X,
multivector  A
 

Evaluates the rejection of X from A.

Parameters:
X The blade to be rejected.
A The blade from which X is to be rejected.
Returns:
The blade component of X that is orthogonal to A.
Since:
v1.0

multivector RotorC2 scalar  angle  ) 
 

Creates a rotor, i.e. multivector of mixed grades zero, two and four, in 2D-conic space.

Parameters:
angle rotation angle in radians.
Returns:
Rotor operator in 2D-conic space, for a rotation about the given angle.
Since:
v2.0
For example, a rotation of any multivector may be done as follows:
    R = RotorC2(Slider("fac", 0, 2, 0.05, 0) *Pi);
    
    :Red;
    // A hyperbola in the OPNS
    :x = *VecC2(Matrix( [[1,0,0], [0,-2,0], [0,0,-1]] ));
    
    :Blue;
    // The rotated hyperbola
    :y = R * x * ~R;

multivector RotorE3 multivector  U,
scalar  angle
 

Creates a rotor, i.e. multivector of mixed grades zero and two, in Euclidean space.

Parameters:
U Rotation plane or axis.
angle rotation angle in radians.
Returns:
Rotor operator in Euclidean space, for a rotation about the given angle and the rotation axis or plane.
Since:
v1.0
The multivector U either gives the rotation axis or the rotation plane. If U contains any vector components it is assumed to give the rotation axis. If, on the other hand, all vector components are zero, it is assumed to give the rotation plane. The rotation angle is given in degrees.
    
    DefVarsE3();
    ?U = e1^e2;
    ?R = RotorE3(U, Pi/2);
    :R :Red;

This produces the following output.

    U = 1^e12
    R = 0.707 + -0.707^e12

multivector RotorE3 scalar  x,
scalar  y,
scalar  z,
scalar  angle
 

Creates a rotor, i.e. multivector of mixed grades zero and two, in Euclidean space.

Parameters:
x x-component of rotation axis.
y y-component of rotation axis.
z z-component of rotation axis.
angle rotation angle in radians.
Returns:
Rotor operator in Euclidean space, for a rotation about the given angle and the rotation axis.
Since:
v1.0
For example, a rotation about the y-axis by an angle of $\pi/4$ of any multivector may be done as follows:
    
    R = RotorE3(0,1,0, Pi/4);
    
    :Red;
    :x = VecE3(1,0,0);
    
    :Blue;
    :y = R * x * ~R;

multivector RotorN3 multivector  U,
scalar  angle
 

Creates a rotor, i.e. multivector of mixed grades zero and two, in conformal space.

Parameters:
U Rotation plane or axis.
angle rotation angle in radians.
Returns:
Rotor operator in conformal space, for a rotation about the given angle and the rotation axis or plane.
Since:
v1.0
The multivector U either gives the rotation axis or the rotation plane. If U contains any vector components it is assumed to give the rotation axis. If, on the other hand, all vector components are zero, it is assumed to give the rotation plane. The rotation angle is given in degrees.
    
    DefVarsN3();
    ?U = e1^e2;
    ?R = RotorN3(U, Pi/2);
    :R :Red;

This produces the following output.

    U = 1^e12
    R = 0.707 + -0.707^e12

multivector RotorN3 scalar  x,
scalar  y,
scalar  z,
scalar  angle
 

Creates a rotor, i.e. multivector of mixed grades zero and two, in conformal space.

Parameters:
x x-component of rotation axis.
y y-component of rotation axis.
z z-component of rotation axis.
angle rotation angle in radians.
Returns:
Rotor operator in conformal space, for a rotation about the given angle and the rotation axis.
Since:
v1.0
For example, a rotation about the y-axis by an angle of $\pi/4$ of any multivector may be done as follows:
    
    R = RotorN3(0,1,0, Pi/4);
    
    :Red;
    :x = VecN3(1,0,0);
    
    :Blue;
    :y = R * x * ~R;

multivector RotorP3 multivector  U,
scalar  angle
 

Creates a rotor, i.e. multivector of mixed grades zero and two, in projective space.

Parameters:
U Rotation plane or axis.
angle rotation angle in radians.
Returns:
Rotor operator in projective space, for a rotation about the given angle and the rotation axis or plane.
Since:
v1.0
The multivector U either gives the rotation axis or the rotation plane. If U contains any vector components it is assumed to give the rotation axis. If, on the other hand, all vector components are zero, it is assumed to give the rotation plane. The rotation angle is given in degrees.
    
    DefVarsP3();
    ?U = e1^e2;
    ?R = RotorP3(U, Pi/2);
    :R :Red;

This produces the following output.

    U = 1^e12
    R = 0.707 + -0.707^e12

multivector RotorP3 scalar  x,
scalar  y,
scalar  z,
scalar  angle
 

Creates a rotor, i.e. multivector of mixed grades zero and two, in projective space.

Parameters:
x x-component of rotation axis.
y y-component of rotation axis.
z z-component of rotation axis.
angle rotation angle in radians.
Returns:
Rotor operator in projective space, for a rotation about the given angle and the rotation axis.
Since:
v1.0
For example, a rotation about the y-axis by an angle of $\pi/4$ of any multivector may be done as follows:
    
    R = RotorP3(0,1,0, Pi/4);
    
    :Red;
    :x = VecP3(1,0,0);
    
    :Blue;
    :y = R * x * ~R;

counter Size multivector  M  ) 
 

Returns the algebra dimension of a multivector.

Parameters:
M A multivector.
Returns:
The dimension ($2^n$ ) of the associated algebra.
Since:
v2.0
The expression ? [ Size( VecN3( 1,2,3) ), Size( VecE3( 1,2,3 ) ) ]; will give the answer [32, 8]. Size applied to a scalar val is equivalent to $( \mathtt{val}\; != 0)$ .

multivector SphereN3 scalar  x,
scalar  y,
scalar  z,
scalar  radius
 

Creates a multivector of grade four representing a sphere in Euclidean space.

Parameters:
x x-coordinate of center point.
y y-coordinate of center point.
z z-coordinate of center point.
radius The radius of the sphere.
Returns:
Multivector of grade 4, i.e. a 4-blade, whose outer product null space (OPNS) represents a sphere in Euclidean space.
Since:
v1.0
Attention:
This function now differs from its version in CLUScript 1.3, in that the multivector returned represents a sphere in its OPNS and not IPNS.
The formula used is $S = (A - \frac{1}{2} \rho^2 e)^*$ , where A is a null vector representing the center of the sphere, and $\rho$ is the radius of the sphere.

In the following example a green sphere with center (1,1,1) and radius 0.5 is drawn.

:Green;
:Sp = SphereN3(1,1,1, 0.5);
?*Sp;

This script produces the following output.

Sp = 1^e1 + 1^e2 + 1^e3 + 1.375^e + 1^e0

multivector SphereN3 multivector  center,
scalar  radius
 

Creates a multivector of grade four representing a sphere in Euclidean space.

Parameters:
center A vector in Euclidean, projective or conformal space that gives the center of the sphere.
radius The radius of the sphere.
Returns:
Multivector of grade 4, i.e. a 4-blade, whose outer product null space (OPNS) represents a sphere in Euclidean space.
Since:
v1.5
The formula used is $S = (A - \frac{1}{2} \rho^2 e)^*$ , where A is a null vector representing the center of the sphere, and $\rho$ is the radius of the sphere.

multivector TranslatorN3 scalar  x,
scalar  y,
scalar  z
 

Creates a multivector that acts as a translation operator in conformal space.

Parameters:
x x-component of translation vector.
y y-component of translation vector.
z z-component of translation vector.
Returns:
Multivector of mixed grade zero and two, that acts as a translation operator.
Since:
v1.0
The following example code creates a translator and translates a vector with it.
    
    T = TranslatorN3(1,1,1);
    ?A = VecN3(0,0,0);
    ?B = T * A * ~T;

This script produces the following output.

      
    A = 1^e0
    B = 1^e1 + 1^e2 + 1^e3 + 1.5^e + 1^e0

multivector VecC2 matrix  M  ) 
 

Creates a vector, i.e. multivector of grade one, in 2D-conic space, which is the embedding of the given symmetric 3 by 3 matrix.

Parameters:
M A 3 by 3 symmetric matrix that is to be embedded.
Returns:
The embedding of M into 2D-conic space.
Since:
v2.0
Note that the 2D-conic vector space (which is six dimensional) is just an embedding of symmetric 3 by 3 matrices. This function allows you to embed such symmetric matrices directly.

multivector VecC2 multivector  A  ) 
 

Creates a vector, i.e. multivector of grade one, in 2D-conic space.

Parameters:
A A vector in Euclidean, projective or conformal space.
Returns:
The embedding of A into 2D-conic space.
Since:
v2.0
See the scripts in the folder ExampleScripts/2D_Conics for a number of examples.

multivector VecC2 counter  mode  ) 
 

Creates a vector, i.e. multivector of grade one, in 2D-conic space, which is directly user controllable.

Parameters:
mode Mouse mode in which vector is affected. This may have a value between 1 and 9.
Returns:
Vector at the position controlled by the given mouse mode.
Since:
v2.0
For example, if you write A = VecC2(1), then the value of A can be changed by switching the mouse mode in the visualization window to one, hold down the right mouse button over the visualization window and move the mouse. Try the following simple script to see how it works.

      
    :Red;
    :A = VecC2(1);
    ?A;

Also see the scripts in the folder ExampleScripts/2D_Conics for more advanced examples.

multivector VecC2 scalar  x,
scalar  y
 

Creates a vector, i.e. multivector of grade one, in 2D-conic space.

Parameters:
x x-coordinate of vector.
y y-coordinate of vector.
Returns:
Vector at position (x, y) in 2D-conic space.
Since:
v2.0
In order to draw the conic passing through the 2D-points (1,0), (0,1), (-1,0), (0,-1) and (1.5, 1.5) simply write
    
    // Define and draw the five points
    :Red;
    :A = VecC2(1,0);
    :B = VecC2(0,1);
    :C = VecC2(-1,0);
    :D = VecC2(0,-1);
    :E = VecC2(1.5, 1.5);
    
    // Now draw the conic through the points
    :Blue;
    :A^B^C^D^E;

Also see the scripts in the folder ExampleScripts/2D_Conics for more advanced examples.

multivector VecE3 multivector  A  ) 
 

Creates a vector, i.e. multivector of grade one, in Euclidean space.

Parameters:
A A vector in Euclidean, projective or conformal space.
Returns:
The projection of A into Euclidean space.
Since:
v1.4
Here is an example of how this works.
     
    ?A = VecE3(1, 1, 1);
    ?B = VecP3(A);
    ?C = VecN3(B);

This produces the following output.

     
    A = 1^e1 + 1^e2 + 1^e3
    B = 1^e1 + 1^e2 + 1^e3 + 1^e4
    C = 1^e1 + 1^e2 + 1^e3 + 1.5^e + 1^e0

multivector VecE3 counter  mode  ) 
 

Creates a vector, i.e. multivector of grade one, in Euclidean space, which is directly user controllable.

Parameters:
mode Mouse mode in which vector is affected. This may have a value between 1 and 9.
Returns:
Vector at the position controlled by the given mouse mode.
Since:
v1.0
For example, if you write A = VecE3(1), then the value of A can be changed by switching the mouse mode in the visualization window to one, hold down the right mouse button over the visualization window and move the mouse. Try the following simple script to see how it works.

      
    :Red;
    :A = VecE3(1);
    ?A;

multivector VecE3 scalar  x,
scalar  y,
scalar  z
 

Creates a vector, i.e. multivector of grade one, in Euclidean space.

Parameters:
x x-coordinate of vector.
y y-coordinate of vector.
z z-coordinate of vector.
Returns:
Vector at position (x, y, z) in Euclidean space.
Since:
v1.0

multivector VecN3 multivector  A  ) 
 

Creates a vector, i.e. multivector of grade one, in conformal space.

Parameters:
A A vector in Euclidean, projective or conformal space.
Returns:
The embedding of A in conformal space.
Since:
v1.4
Here is an example of how this works.
     
    ?A = VecE3(1, 1, 1);
    ?B = VecP3(A);
    ?C = VecN3(B);

This produces the following output.

     
    A = 1^e1 + 1^e2 + 1^e3
    B = 1^e1 + 1^e2 + 1^e3 + 1^e4
    C = 1^e1 + 1^e2 + 1^e3 + 1.5^e + 1^e0

multivector VecN3 counter  mode  ) 
 

Creates a vector, i.e. multivector of grade one, in conformal space, which is directly user controllable.

Parameters:
mode Mouse mode in which vector is affected. This may have a value between 1 and 9.
Returns:
Vector representing point at the position controlled by the given mouse mode.
Since:
v1.0
For example, if you write A = VecN3(1), then the value of A can be changed by switching the mouse mode in the visualization window to one, hold down the right mouse button over the visualization window and move the mouse. Try the following simple script to see how it works.

      
    :Red;
    :A = VecN3(1);
    ?A;

multivector VecN3 scalar  x,
scalar  y,
scalar  z
 

Creates a vector, i.e. multivector of grade one, in conformal space.

Parameters:
x x-coordinate of vector.
y y-coordinate of vector.
z z-coordinate of vector.
Returns:
Vector in conformal space representing a point at position (x, y, z) in the corresponding Euclidean space.
Since:
v1.0
The following formula is used to create the conformal vector.

\[ x\, e_1 + y\, e_2 + z\, e_3 + \frac{1}{2}\;(x^2 + y^2 + z^2)\; e + e_0 \]

multivector VecP3 multivector  A  ) 
 

Creates a vector, i.e. multivector of grade one, in projective space.

Parameters:
A A vector in Euclidean, projective or conformal space.
Returns:
The embedding or projection of A into projective space.
Since:
v1.4
Here is an example of how this works.
     
    ?A = VecE3(1, 1, 1);
    ?B = VecP3(A);
    ?C = VecN3(B);

This produces the following output.

     
    A = 1^e1 + 1^e2 + 1^e3
    B = 1^e1 + 1^e2 + 1^e3 + 1^e4
    C = 1^e1 + 1^e2 + 1^e3 + 1.5^e + 1^e0

multivector VecP3 counter  mode  ) 
 

Creates a vector, i.e. multivector of grade one, in projective space, which is directly user controllable.

Parameters:
mode Mouse mode in which vector is affected. This may have a value between 1 and 9.
Returns:
Vector at the position controlled by the given mouse mode.
Since:
v1.0
For example, if you write A = VecP3(1), then the value of A can be changed by switching the mouse mode in the visualization window to one, hold down the right mouse button over the visualization window and move the mouse. Try the following simple script to see how it works.

      
    :Red;
    :A = VecP3(1);
    ?A;

multivector VecP3 scalar  x,
scalar  y,
scalar  z
 

Creates a vector, i.e. multivector of grade one, in projective space.

Parameters:
x x-coordinate of vector.
y y-coordinate of vector.
z z-coordinate of vector.
Returns:
Vector in projective space that represents a point at position (x, y, z) in the corresponding Euclidean space.
Since:
v1.0