Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Matrix transformation and common sense
 

Matrix transformation and common sense

Hi,

Can anyone help me on the following please, thanks in advance:

Common sense and some experimentation shows that if you need to just scale and translate (and not rotate) an image, the order of operations should not be important. So scaling an image 200% and then translating it 10% in x-axis would give the same output as translating it 10% in x-axis and then scaling it 200%. You can do some thought experiment or use Photoshop or even Paint to verify this.

Now check the following. This is how a Matrix would represent these two operations. Here we do a scaling following by a translation (themiddle one is a 2x2 scaling matrix, and thenext one is the translation matrix):

[xy]*[m 0] + [a b] = [mx + amy + b]

[0 m]

And on the other hand, we change the order:

[xy]+ [a b]*[m 0]= [mx + mamy + mb]

[0 m]

See the change! Can anyone tell me if I am doing anything wrong here, or if order of operations is really important and the common sense is missing something.

Shujaat

Syed Shujaat Hussain  Tuesday, November 20, 2007 3:51 PM

I think you math is wrong here. You multiply the image by the matrix to transform the image. You multiply the results of the first transformation by the second. I think your + sign should be a *

Ken Tucker  Thursday, November 22, 2007 11:40 AM

I think you math is wrong here. You multiply the image by the matrix to transform the image. You multiply the results of the first transformation by the second. I think your + sign should be a *

Ken Tucker  Thursday, November 22, 2007 11:40 AM

You can use google to search for other answers

Custom Search

More Threads

• OleDbConnection as global variable
• How can I resolve DataGridView and CDialog bug
• DataSet Clear() performance problem
• Writing values to a table in DataSet
• Adding Child Row Automatically When Parent is Added
• to implement hierarchy of employees with the help of tree view using ado.net in c#
• datagridview making one eventhandler
• RTF Control did not support Correct Spelling in VS 2008 Beta2
• Bug in Typed DataSet Designer?
• MS Access Query On Form Textbox?