Notebook 10 – Math 2121, Fall 2020

In this short demonstration we explore the physical meaning of the sign of a determinant.

Some terminology:

  • An invertible matrix with positive determinant is called orientation-preserving.

  • An invertible matrix with negative determinant is called orientation-reversing.

Whether an n×n matrix is orientation-preserving or orientation-reversing is something we can "just see," at least when n=2, simply by looking at how the matrix transforms a set of points.

However, it's not so easy to make a rigorous definition of these properties without referencing the determinant.

15.9 μs
20 s

A black and white image is encoded by a set of vectors v=[v1v2]R2: one vector for each black pixel at horizontal position v1 and vertical position v2.

A 2×2 matrix A transforms such an image to another image, in which each vector v is replaced by Av. By comparing these images, we will be able to see whether A is orientation-preserving or orientation-reversing.

9.2 μs
extract_image (generic function with 1 method)
45.1 μs
g
2×67870 Array{Any,2}:
 380  380  380  380  380  380  380  380  …   12   12   12   12   12   12   12   12
 198  199  200  201  202  203  204  205     431  432  433  434  435  436  437  438
195 ms

Here is what this image looks like if we plot all of the points:

7.6 μs
make_displayable (generic function with 1 method)
50.9 μs
134 ms

Below are some functions to create random n-by-n matrices with determinant +1 or 1.

We'll just need the n=2 case of these methods.

11.3 μs
randmat (generic function with 1 method)
48.1 μs
positive_determinant (generic function with 1 method)
35.5 μs
negative_determinant (generic function with 1 method)
35.7 μs
illustrate (generic function with 1 method)
38.2 μs

The plots below show our starting image transformed by random matrices A with positive and negative determinant.

Roughly speaking, if the matrix A has positive determinant, so is orientation-preserving, then the transformed image "looks the same (but rotated)." This is shown on the left.

If the matrix A has negative determinant, so is orientation-reversing, then the transformed image is somehow "the mirror image (but rotated)" of we started with. This is shown on the right.

5.8 μs
266 ms