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?

$\endgroup$
1
$\begingroup$

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

$\endgroup$
4
  • $\begingroup$ Could you be a bit more elaborate? $\endgroup$ – picakhu Feb 8 '11 at 15:24
  • $\begingroup$ @picakhu : OK, threw in some plots. $\endgroup$ – Jacob Feb 9 '11 at 1:47
  • $\begingroup$ Thanks for that. I was sort of hoping for arrows. on one diagram. $\endgroup$ – picakhu Feb 9 '11 at 3:40
  • $\begingroup$ @picakhu: Updated with arrows. $\endgroup$ – Jacob Feb 9 '11 at 17:47
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.