5
$\begingroup$

question1:

(code 1 something wrong, Why? and how to overcome this to achieve the next code's effect)

Inner[RotationTransform,{Pi/4,Pi/4,Pi/4},{{0,0,1},{1,0,0},{0,0,1}},Composition]

(code2 it's ok, but seems type too much characters)

Inner[RotationTransform,{Pi/4,Pi/4,Pi/4},{xx,yy,zz},Composition]/.
                                           Thread[Rule[{xx,yy,zz},{{0,0,1},{1,0,0},{0,0,1}}]]

Any other codes or tips are welcome.

$\endgroup$
3
  • 1
    $\begingroup$ Use Composition @@ MapThread[RotationTransform, {{Pi/4, Pi/4, Pi/4}, {{0, 0, 1}, {1, 0, 0}, {0, 0, 1}}}] instead. $\endgroup$ May 4, 2013 at 1:53
  • 1
    $\begingroup$ @J. M. ok, I found this is more simpler in my original code'style. Inner[RotationTransform,{Pi/4,Pi/4,Pi/4},Hold/@{{0,0,1},{1,0,0},{0,0,1}},Composition]//Release $\endgroup$ May 4, 2013 at 2:04
  • 1
    $\begingroup$ ReleaseHold[] is what the cool kids use nowadays. $\endgroup$ May 4, 2013 at 2:07

1 Answer 1

8
$\begingroup$

you can just add Unevaluated to prevent Inner from seeing inside:

Inner[RotationTransform, {Pi/4, Pi/4, Pi/4}, 
 Unevaluated /@ {{0, 0, 1}, {1, 0, 0}, {0, 0, 1}}, Composition]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.