# How do I compose two functions (matrices) in Mathematica? [closed]

I'm new to Mathematica. I've been reading the 'Documentation Center' but can't find a clue about composing two functions which in my case are matrices.

Here's the setup. let T01 be a homogeneous transform matrix, and T12 another one. The two of them are function of q1 & q2 :

T01[q1_, q2_] = {{Cos[q1 Degree], 0, Sin[q1 Degree], 0}, {0, 1, 0, 0},
{-Sin[q1 Degree], 0, Cos[q1 Degree], 0}, {0, 0, 0,  1}};

T12[q1_, q2_] = {{Cos[q2 Degree], 0, Sin[q2 Degree], 0}, {0, 1, 0,  0},
{-Sin[q2 Degree], 0, Cos[q2 Degree], -l1}, {0, 0, 0, 1}};


I'd like to create a function T02 so that T02[q1_,q_2]=T01[q1_,q2_].T02[q1_,q_2]

How should I do this? I tried the Composition[] function already but I may be missing something...

I tried this :

 Composition[T01,T02][q1_,q2_]


But I didn't get any results...

Thanks for the help in advance.

-
In the strict sense, composing T01 and T12 is not defined, because each of them are functions mapping an ordered pair (Mathematica Sequence) into a $4$ by $4$ matrix: because such a matrix is not an ordered pair, composition is impossible. If you want to compose the matrices that these functions return, considered as endomorphisms of a four-dimensional vector space, then matrix multiplication does the trick (this is a theorem but it's elementary). –  whuber Jan 20 at 12:35
I think T[q1_, q2_] = T01[q1, q2].T12[q1, q2] will be ok.