Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Note that the inversion of matrix is not that trivial at all! Firstly, all n (where n is the dimension of your space) points must be in general position (i.e. no individual point can be expressed as a linear combination of rest of the points [caveat: this may seem to be a simple requirement indeed, but in the realm of numerical linear algebra, it's nontrivial; final decison wheter such configuration really exist or not, will eventually be based on the 'actual domain' specific knowledge]). </p> <p>Also the 'correspondence' of the new and old points may not be exact (and then you should utilize the best possible approximator of the 'true correspondence', i.e.:). Pseudo inverse (instead of trying to utilize the plain inverse) is recommend allways when your lib provides it. </p> <p>The pseudo inverse has the advantage that you'll be able to use more points for your transformation, hence increasing the probability that at least n points will be in general position. </p> <p>Here is an example, rotation of unit square 90 deg. ccw in 2D (but obviously this determination works in any dim), with <code>numpy</code>:</p> <pre><code>In []: P= matrix([[0, 0, 1, 1], [0, 1, 1, 0]]) In []: Pn= matrix([[0, -1, -1, 0], [0, 0, 1, 1]]) In []: T= Pn* pinv(P) In []: (T* P).round() Out[]: matrix([[ 0., -1., -1., 0.], [ 0., 0., 1., 1.]]) </code></pre> <p>P.S. <code>numpy</code> is also fast. Transformation of 1 million points in my modest computer:</p> <pre><code>In []: P= matrix(rand(2, 1e6)) In []: %timeit T* P 10 loops, best of 3: 37.7 ms per loop </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload