I want to construct a triangular lattice with spins in 120° direction. Similar to that one here: .
This is my idea of how it should look (except that the lattice is not equilateral in that picture, but I want it to be equilateral):
I found this code
Example: Drawing lattice points and vectors, but I don't get a equilateral triangle.
This is the changed code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{figure}[ht]
\centering
\begin{tikzpicture}
\coordinate (Origin) at (0,0);
\coordinate (XAxisMin) at (-3,0);
\coordinate (XAxisMax) at (5,0);
\coordinate (YAxisMin) at (0,-2);
\coordinate (YAxisMax) at (0,5);
\draw [thin, gray,-latex] (XAxisMin) -- (XAxisMax) node[right] {$x$};% Draw x axis
\draw [thin, gray,-latex] (YAxisMin) -- (YAxisMax) node[above] {$z$} ;% Draw y axis
\clip (-4,-3) rectangle (5cm,5cm); % Clips the picture...
\pgftransformcm{0.866}{0}{1/2}{1}{\pgfpoint{0cm}{0cm}}
% This is actually the transformation matrix entries that
% gives the slanted unit vectors. You might check it on
% MATLAB etc. . I got it by guessing.
\coordinate (Bone) at (0,2);
\coordinate (Btwo) at (2,-2);
\draw[style=help lines,dashed] (-6,-6) grid[step=2cm] (6,6);
% Draws a grid in the new coordinates.
%\filldraw[fill=gray, fill opacity=0.3, draw=black] (0,0) rectangle (2,2);
% Puts the shaded rectangle
\foreach \x in {-4,-3,...,4}{% Two indices running over each
\foreach \y in {-4,-3,...,4}{% node on the grid we have drawn
\node[draw,circle,inner sep=2pt,fill] at (2*\x,2*\y) {};
% Places a dot at those points
}
}
\draw [ultra thick,-latex,red] (Origin)
-- (Bone) node [above right] {$a(1/2,0,\sqrt{3}/2)$};
\draw [ultra thick,-latex,red] (Origin)
-- (Btwo) node [below right] {$a(1/2,0,-\sqrt{3}/2)$};
\draw [ultra thick,-latex,red] (Origin)
-- ($(Bone)+(Btwo)$) node [below right] {$a(1,0,0)$};
\draw [ultra thick,-latex,red] (Origin)
-- ($-1*(Bone)-1*(Btwo)$) node [below left] {$a(-1,0,0)$};
\draw [ultra thick,-latex,red] (Origin)
-- ($-1*(Btwo)$) node [above left] {$a(-1/2,0,\sqrt{3}/2)$};
\draw [ultra thick,-latex,red] (Origin)
-- ($-1*(Bone)$) node [below left] {$a(-1/2,0,-\sqrt{3}/2)$};\end{tikzpicture}
\end{figure}
\end{document}
To summarize:
- How can I get the spins on the lattice points?
- How can I get an equilateral triangular lattice?
- How can I construct new dashed lines as shown in the picture above?
Best Answer