[scilab-Users] Matrix transformations

Samuel Gougeon sgougeon at free.fr
Wed Oct 12 20:07:24 CEST 2011


Hi,

If you assume that the transform is linear and can be described by
a matrix T such that  B = T*A, then you merely get T as
T = B / A
-->T = B/A
  T  =

     0.    0.           0.           0.
     0.    80113.778  - 80081.268    0.
     0.  - 11913.312    11955.211    0.
     0.    92027.09   - 92036.479    0.

then, checking that T*A gives B :
-->T*A
  ans  =
     0.           0.
     2131.        1534.
     2131.        1.455D-11
   - 9.313D-10    1534.

-->B
  B  =
     0.       0.
     2131.    1534.
     2131.    0.
     0.       1534.

// So, it's OK. T*A has some residues as big as ~10^-10 instead of 0, 
due to
// numerical approximations (finite number of digits in inputs and during
// the processing).

Then, if you wish to decompose T as a rotation o translation o scaling,
it is an additional piece of work.

HTH
Samuel

Le 12/10/2011 18:25, Capitao Obvio a écrit :
> Hi!
>
> I'm starting to work with Scilab, and I'm trying to figure out how to 
> work with matrices.
>
> My goal is to find a way to convert any point from one system into 
> another.
>
> My (failed) approach so far was to estimate the necessary rotation, 
> translation and scale; but it didn't work quite well, because the 
> second map is slightly distorted (probably due perspective).
>
> Being a bit more specific:
>
> I have the following points:
>
> A = [
> [52.363965, 4.892435],
> [52.384611, 4.898272],
> [52.379267, 4.881105],
> [52.369678, 4.911489],
> ]
>
>
> They correspond to these points:
>
> B = [
> [0, 0],
> [2131, 1534],
> [2131, 0],
> [0, 1534],
> ]
>
> Do you have any suggestions on how to calculate tje transform from A to B?
>
> Thanks in advance,
>
> Cap.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20111012/86ed8dd1/attachment.htm>


More information about the users mailing list