Skip to content

Getting wrong type of multivector #484

@ingodahn

Description

@ingodahn

I am trying to calculate the image of a 3D vector $u=e_1+2e_2+3e_3$ under the rotation with axis vector $e_1+e_2+e_3$. I would expect to get a vector as image but the calculation yields a vector + a tiny multiple of $e_1\wedge e_2\wedge e_3$, perhaps due to rounding errors.

The code is attached
gaerror.txt

import sympy
from sympy import symbols
from galgebra.ga import *
from galgebra.printer import latex
from IPython.display import Math
import math
pi=math.pi
e=math.e
sin=math.sin
cos=math.cos
# tell sympy to use our printing by default
sympy.init_printing(latex_printer=latex, use_latex='mathjax')
xyz = (x, y, z) = symbols('x y z', real=True)
o3d = Ga('e_1 e_2 e_3', g=[1, 1, 1], coords=xyz)
e_1, e_2, e_3 = o3d.mv()
I=e_1*e_2*e_3
def normed(x):
    return (1/x.norm())*x
n=normed(e_1+e_2+e_3)
theta=pi/4
i=n*I
def expo(xx,tt):
    return cos(tt/2)+xx*sin(tt/2)
def RR(uu,ii,tt):
    return expo(-ii,tt)*uu*expo(ii,tt)
u=e_1+2*e_2+3*e_3
v=RR(u,i,theta)
v

Edit: Using an updated version of galgebra as described in http://www.faculty.luther.edu/~macdonal/GAlgebraPrimer.pdf and then using the exp() method from galgebra yields exactly the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions