# Sketching vector diagram

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?

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:

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

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.