Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question about the RotationTransform function in Mathematica

Background:

  a = 0; b = 0; c = 0;
  Manipulate[Graphics3D[
    GeometricTransformation[
     {Cuboid[{0, 0, 0}, {1, 1, 1}]},
     {RotationTransform[x, {1, 1, 0}, {a, b, c}]}], 
    ViewPoint -> Left], {x, 0, 2 \[Pi]}]

My question concerns RotationTransform with the following signature:

  RotationTransform[x, {1, 1, 0}, {a, b, c}]

The documentation says: "gives a 3D rotation around the axis w anchored at the point p", in the example above w={1,1,0} and p={a,b,c}.

To my surprise the rotation acts the same no matter what values I assign to (a,b,c). I assume that I don't understand the docs, made an error somewhere. I would have expected at least a different rotation for different values of a,b,c. Changing the vector w behaves as expected.

Please explain the purpose of p.

like image 548
nilo de roock Avatar asked Jul 23 '11 18:07

nilo de roock


People also ask

How do you rotate text in Mathematica?

You can rotate text in Mathematica by wrapping it with Rotate and specifying an angle and center of rotation. As rotation may cause the rotated text to shift horizontally and vertically, the center of rotation does not stay fixed. The height of the center of rotation above the baseline of the text, however, is fixed.

What is the head of an expression in Mathematica?

Expressions in Mathematica always have exactly one head ( Head[expr] or expr[[0]] ) and zero or more elements or parts ( expr[[k]] ). Both head and elements are themselves expressions. Standard way of writing an expression: head[element1, element2, ...] .

What can Wolfram Mathematica do?

Wolfram Mathematica is a technical computing solution that provides businesses of all sizes with tools for image processing, data visualization and theoretic experiments. The notebook interface enables users to organize documents including texts, runnable codes, dynamic graphics and more.


1 Answers

Consider the following example from the help:

gr={Cuboid[],AbsolutePointSize[10],Opacity[1],{Magenta,Point[{0,0,0}]},   
   {Green,Point[{1,1,1}]}};

p = {1,1,1};
Graphics3D[{{Opacity[.35], Blue, gr}, 
  GeometricTransformation[{Opacity[.85], Red, gr}, 
   RotationTransform[Pi/6, {0, 0, 1}, p]]}, Boxed -> False]

enter image description here

And now with :

p={1,0,0};

enter image description here

like image 121
Dr. belisarius Avatar answered Sep 22 '22 13:09

Dr. belisarius