The ; is doing vertical concatenation of the two row vectors i_hat1 and j_hat1, followed by transposition using' as a suffix.
Be careful with the last line. You have used numpy’s dot function which does quite a lot of things depending on the input type. In this case it should give the sum product over the last axes. I have just written a standard matrix-vector product.
I had read an thread about the dot with python and was aware of the issues you told, but in some calc with vectors, “,” did the trick. For matrix, needed vertical concatenation as you show. We must pay attention in this detail.
From vector to matrix doing the transpose operation, as the version in python did and the book says to do; ihs and jhs are vector, then better implement they as vectors. Python and numpy are hidding lots of things.
begin
ih1 = [0, 1];
jh1 = [-1, 0];
ih2 = [1, 0];
jh2 = [1, 1];
transform1 = [ih1'; jh1']';
transform2 = [ih2'; jh2']';
result = transform2 * transform1;
v1 = [1, 2];
result * v1
end
I still think the question and the replies would benefit from an explanation of what the OP is trying to accomplish, mathematically. The way transform1 and transform2 are built is unnecessarily complicated. You can get the same in four lines with