Group Abstract Group Abstract

Message Boards Message Boards

0
|
3K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Add a vector onto the specific column of TransformationFunction.

Posted 3 years ago
POSTED BY: Hongyi Zhao
2 Replies
Posted 3 years ago

Hi Henrik Schachner,

Thank you very much. It does the trick.

N.B.: I noticed another wonderful example, helpful to understand the RotationTransform function in Mathematica

Manipulate[
  Module[{w={1,0,0},p={-2,2}},
    Graphics3D[
    {
       {Opacity->.4,GeometricTransformation[
         {Cuboid[{0,0,0}]},RotationTransform[angle,w,{a,b,c}]]
        },

       {Blue,PointSize[0.05],Point[{a,b,c}]},
       {Red,Thick,Line[{{a,b,c},{a,b,c}+w}]}
    },

    ImageSize->300,
    ImagePadding->2,AxesOrigin->{0,0,0},
    ImageMargins->2,ViewAngle->All,
    Axes->True,
    Ticks->None,
    PlotRange->{p,p,p}
    ]
  ],

  {angle,0,2 \[Pi],ImageSize->Tiny},
  {{a,0,"a"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
  {{b,0,"b"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
  {{c,0,"c"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},

   ControlPlacement->Left
]

Best, Zhao

POSTED BY: Hongyi Zhao

Zhao,

here is one way: Let g be your original transformation function,

g = RotationTransform[Pi, {1, 0, 0}, {x, 1/2, 1/4}]

then what you need is an additional translation by {1/2, 0, 0}:

TransformationFunction[TransformationMatrix[g].TransformationMatrix[TranslationTransform[{1/2, 0, 0}]]]
POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard