Yes, it is. Type:

*MatMul(R, T, hold=True)*

In [1]: x, y, ori = symbols('x y ori')

In [2]: T = Matrix([
   ...: [1, 0, -x],
   ...: [0, 1, -y],
   ...: [0, 0,  1]])

In [3]: R = Matrix([
   ...: [ cos(ori), sin(ori), 0],
   ...: [-sin(ori), cos(ori), 0],
   ...: [        0,        0, 1]])

In [4]: MatMul(R, T, hold=True)
Out[4]: 
[cos(ori)   sin(ori)  0]*[1  0  -x]
[                      ] [        ]
[-sin(ori)  cos(ori)  0] [0  1  -y]
[                      ] [        ]
[    0         0      1] [0  0  1 ]



On Tuesday, 28 July 2015 21:31:07 UTC+2, Jonathan Crall wrote:
>
> I'm using sympy to generate some latex output, and I would like to create 
> an expression by multiplying several matrices, but I don't want it to 
> simply the expression. 
>
>
> A simple example: 
>
> I have 
>
> x, y, ori = sympy.symbols('x y ori')
>
>
> T = Matrix([
> [1, 0, -x],
> [0, 1, -y],
> [0, 0,  1]])
>
> R = Matrix([
> [ cos(ori), sin(ori), 0],
> [-sin(ori), cos(ori), 0],
> [        0,        0, 1]])
>
> A = R.multiply(T)
>
> Currently sympy.latex(A) looks something like: 
>
> [[ cos(ori), sin(ori), -x*cos(ori) - y*sin(ori)],
> [-sin(ori), cos(ori),  x*sin(ori) - y*cos(ori)],
> [        0,        0,                        1]])
>
> But I would like something more like this: 
>
> [[ cos(ori), sin(ori), 0],       [1, 0, -x],
>  [-sin(ori), cos(ori), 0],       [0, 1, -y],
>  [        0,        0, 1]])      *    [0, 0,  1]]
>
> Is it possible to disable the automatic expression evaluation?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/138910bf-9c4b-41fc-b99d-55f34baac606%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to