# equilateral triangle in tikz

I was wondering if there is a way to define an equilateral triangle in tikz. I am aware that there is a predefined isosceles triangle in tikz. Specifically I'd like to define a \tikzstyle for equilateral triangle and use it in my diagram. The similar situation with isosceles triangle is something like

\tikzstyle{buffer} = [draw,shape border rotate=-90, isosceles triangle,fill=red, node distance=2cm, minimum height=4em]


However, replacing isosceles with equilateral doesn't work. Thanks

-

There is also the regular polygon shape.

(I shamelessly stole and modified Jakes code for this.)

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\tikzset{
buffer/.style={
draw,
shape border rotate=180,
regular polygon,
regular polygon sides=3,
fill=red,
node distance=2cm,
minimum height=4em
}
}

\begin{document}
\begin{tikzpicture}
\node[buffer]{Test};
\end{tikzpicture}
\end{document}

-
Nice! This actually makes more sense in this case, since now the label text is placed better, and the corner nodes are called corner 1, corner 2 and corner 3 instead of apex, right corner and left corner. –  Jake Dec 30 '12 at 17:31
This is great! Thank you :) –  N Nik Dec 30 '12 at 17:35

You can just set isosceles triangle apex angle=60 to get an equilateral triangle. The length of the sides is set using minimum width=<length>.

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\tikzset{
buffer/.style={
draw,
shape border rotate=-90,
isosceles triangle,
isosceles triangle apex angle=60,
fill=red,
node distance=2cm,
minimum height=4em
}
}

\begin{document}
\begin{tikzpicture}

\node[buffer]{Test};
\end{tikzpicture}

\end{document}

-
Thank you, this is also the correct answer; however, for the reason you explained , I am gonna go ahead and accept the other one. Hope you don't mind... –  N Nik Dec 30 '12 at 17:36
@NNik: Of course not, it's definitely the right thing to do –  Jake Dec 30 '12 at 18:05