Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How can I determine a 2x2 trasformation matrix which transforms the triangle with vertices (1,0), (-1,0), and (2,-1) to a triangle with vertices (1,1), (-1,-2), and (3,-2)?

share|improve this question
3  
This question appears to be off-topic because it is about mathematics, not about TeX & friends. I reccommend migration to Maths.SX. –  Jubobs Feb 10 at 9:46
3  
If SE moderators confuse Mathematica and Mathematics no wonder why some users do the same.. –  Öskå Feb 10 at 10:21
1  
I said before we should change the name of this forum to Wolfram Language, but no body listens to me. –  Nasser Feb 10 at 10:26
    
Sorry for posting an answer...hmmm –  ubpdqn Feb 10 at 11:00
add comment

migrated from mathematica.stackexchange.com Feb 10 at 13:31

This question came from our site for users of Mathematica.

1 Answer

If the question is how to do this with Mathematica then this particular problem can be done using default FindGeometricTransform (documentation here). In this case it can be solved exactly.

For this particular example:

pts1 = {{1, 0}, {-1, 0}, {2, -1}};
pts2 = {{1, 1}, {-1, 2}, {3, -2}};
tr = Chop[FindGeometricTransform[pts2, pts1]]

This yields:

enter image description here

The transform function can be decomposed using CoefficientArrays

{t, m} = Normal /@ CoefficientArrays[tr[[2]][{x, y}]]

where t is translation vector and m is transform matrix.

The result can be tested:

m.# + t & /@ pts1

yields:

{{1., 1.}, {-1., 2.}, {3., -2.}}

as desired

Or plotted:

ListPlot[{pts2, tr[[2]][#] & /@ pts1}, 
 PlotStyle -> {{Red, PointSize[0.03]}, {Green, PointSize[0.02]}}]

enter image description here

More complex pairs of sets of points and contexts would need deeper consideration (rigid, shear, etc). I again refer you to the documentation.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.