Randomly generating special affine transformations

740 Views Asked by At

I want to generate many random special affine transformations, that is, affine transformations that preserve volume (determinant equal to 1).

I need quite a few of them. Is there a better way than generating random matrices and checking if they have the properties of an affine transformation?

1

There are 1 best solutions below

0
On BEST ANSWER

An easy way to generate matrices with determinant equal to $1$ is to

  1. Generate random matrix $A$
  2. Check whether the determinant of $A$ is zero (with overwhelming probability it will not be zero)
  3. Divide every element of the matrix by $|\det A|^{1/n}$
  4. If $\det A<0$, flip the sign of the first row.

This process creates matrices with real entries. If one needs integer matrices, or a particular distribution of matrices, that's another question...