Group Abstract Group Abstract

Message Boards Message Boards

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

Apply TranslationTransform on a matrix

Posted 3 years ago

See my following example:

In[942]:= TMPG229me3ToITA
TMPG229me3ToITA . (TranslationTransform[{1/8,1/8,1/8}]//TransformationMatrix)

Out[942]= {{3/4, 5/8, 5/8, 0}, {5/8, 3/4, 5/8, 0}, {5/8, 5/8, 3/4, 
  0}, {0, 0, 0, 1}}

Out[943]= {{3/4, 5/8, 5/8, 1/4}, {5/8, 3/4, 5/8, 1/4}, {5/8, 5/8, 3/4,
   1/4}, {0, 0, 0, 1}}

I want to obtain the exactly same result by using TranslationTransform command directly without calling the TransformationMatrix. I tried the following methods, but all cannot achieve the desired goal:

In[946]:= TranslationTransform[{1/8,1/8,1/8,0}][TMPG229me3ToITA]
TranslationTransform[{1/8,1/8,1/8,1}][TMPG229me3ToITA]

Out[946]= {{7/8, 3/4, 3/4, 0}, {3/4, 7/8, 3/4, 0}, {3/4, 3/4, 7/8, 
  0}, {1/8, 1/8, 1/8, 1}}

Out[947]= {{7/8, 3/4, 3/4, 1}, {3/4, 7/8, 3/4, 1}, {3/4, 3/4, 7/8, 
  1}, {1/8, 1/8, 1/8, 2}}

Obviously, I did not understand the use of this command correctly, but no related clues were found in the related documentation. Any tips will be appreciated.

Regards, Zhao

POSTED BY: Hongyi Zhao
7 Replies
Posted 3 years ago

Thank you Hans,

This is perhaps the most flexible and versatile solution to such problems.

POSTED BY: Hongyi Zhao
Posted 3 years ago

You could make your own Operator style function:

In[1]:= transTransform = OperatorApplied[#2 . (TranslationTransform[#1] // TransformationMatrix) &, {1, 2}];

In[2]:= vec = {1/8, 1/8, 1/8};
matrix = {{3/4, 5/8, 5/8, 0}, {5/8, 3/4, 5/8, 0}, {5/8, 5/8, 3/4, 0}, {0, 0, 0, 1}};

In[4]:= transTransform[vec][matrix]
Out[4]= {{3/4, 5/8, 5/8, 1/4}, {5/8, 3/4, 5/8, 1/4}, {5/8, 5/8, 3/4, 1/4}, {0, 0, 0, 1}}
POSTED BY: Hans Milton
Posted 3 years ago

I mean something similar to the following:

TranslationTransform[vec][matrix]

If TranslationTransform can not do this due to its working mechanism in design, are there other similar commands that can do this?

POSTED BY: Hongyi Zhao
Posted 3 years ago

I don't know. I don't know what the "obvious geometric meaning" is.

POSTED BY: Eric Rimbey
Posted 3 years ago
POSTED BY: Hongyi Zhao
Posted 3 years ago
POSTED BY: Eric Rimbey
Posted 3 years ago

I don't think TranslationTransform operates on matrices per se. It operates on nested lists by operating on the low-level elements of the list that have the right "structure" for the dimensions of the given translation parameter. So, in your case, it's just being applied to each 4-element list in the bigger list.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard