Question: Matrix multiplication with lists and ~

Is it possible to use the ~ when using Matrix multiplications, where the second part of the operand are list elements?

The first part of the matrix multiplication remains unchanged, while the second one should be each element of the list.

The result should be a list of vectors / matrices again.

with(Units:-Simple)

alpha := 20*Unit('arcdeg')

20*Units:-Unit(arcdeg)

(1)

TransMatrix := Matrix([[cos(alpha), sin(alpha)], [-sin(alpha), cos(alpha)]])

Matrix(%id = 36893490153509525972)

(2)

pt := Vector(2, {(1) = -25.0, (2) = 0.})

Vector[column](%id = 36893490153504789076)

(3)

ptlist := [Vector(2, {(1) = -25.0, (2) = 0.}), Vector(2, {(1) = 25.0, (2) = 0.})]

[Vector[column](%id = 36893490153504761724), Vector[column](%id = 36893490153504761844)]

(4)

pt_trans := evalf(TransMatrix.pt)

Vector[column](%id = 36893490153514236012)

(5)

pl_translist := evalf(TransMatrix.ptlist)

Matrix(%id = 36893490153509525972).[Vector[column](%id = 36893490153504761724), Vector[column](%id = 36893490153504761844)]

(6)

TransMatrix.ptlist

Error, number of dimensions must be the same for all container objects in an elementwise operation

 

NULL

Download MatrixMultiplicate.mw

Please Wait...