2
$\begingroup$

I need to sketch a diagram which shows what happens when a 2x2 matrix is applied to a lattice. What would be the best software to perform such a thing?

2 Answers 2

1

I've used MATLAB to plot such transformations.


I am assuming you have a lattice of 2D points $x$ and your matrix $A: \mathbb{R}^2 \rightarrow \mathbb{R}^2$.

So you'll get another set of 2D points $x'$ where $x' = Ax$. I use MATLAB to plot both sets of points.

E.g. $A$ is the 2x2 rotation matrix defined below with $\theta = \pi/4$.

$ A = \begin{bmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{bmatrix} $

The MATLAB code:

theta = pi/4; A = [cos(theta) -sin(theta); sin(theta) cos(theta)]; x = [1 1 1 0 0 0 -1 -1 -1;-1 0 1 -1 0 1 -1 0 1]; xp = A*x; 

The new display code:

v = xp - x; axis([-2 2 -2 2]); hold on; plot(x(1,:),x(2,:),'*k'); plot(xp(1,:),xp(2,:),'*r'); quiver(x(1,:),x(2,:),v(1,:),v(2,:),0) 

And the diagram: Diagram

  • 0
    @picakhu: $U$pdated with arrows.2011-02-09
0

There are many diagramming software available, however, I use Visio 2010 which is one of the best diagramming software. I will recommend you to try Visio and see whether it works for you or not.