2

Using the tikz manual I've come up with this:

\documentclass[letterpaper,10pt]{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\draw (0,0) -- (2,0)
    node [pos=0.5] (mpa) {};
\draw (2,0) -- (2,2)
    node [pos=0.5] (mpb) {};
\draw (2,2) -- (0,0)
    node [pos=0.5] (mpc) {};
\draw (0,0) -- (mpb);
\draw (2,2) -- (mpa);
\draw (2,0) -- (mpc);
\end{tikzpicture}
\end{figure}

Which renders: concurrency image

Which is actually close to what I want. As you can tell from the code, the lines are supposed to go from the vertices to the nodes I placed at the midpoints of the opposite sides. The tikz manual implied that placing nodes in this fashion places them on the path rather than near it. Did I misunderstand?

The follow up question is, in reality, I need a node at the point of intersection that is just a circle, i.e. in some manner emphasizing the point of concurrency. Then, lines from that point to only the vertices. Maybe it would be simpler to do this using a single node that is a regular polygon? Please enlighten me.

3
  • Use coordinate rather than node. Nodes have dimensions and lines are drawn to the nearest border anchor.
    – cfr
    Nov 29, 2016 at 23:33
  • I don't understand the follow-up. You want a circle at the point of intersection of the 3 lines. OK. You want a circle there. Fine. Where does the regular polygon come in? The triangle isn't regular, so I'm a bit confused.
    – cfr
    Nov 29, 2016 at 23:39
  • The regular polygon came in because I thought that might be the simplest way to put a point in the center since there's an anchor in the center of the node. I don't have enough space in a comment to illustrate, but using your illustrations and some other stuff from "texample.net" I was able to get what I want. Now, the bigger problem, a central triangle with equilateral triangles along the edges of the central one. Nov 30, 2016 at 4:16

1 Answer 1

3

Node have a size and lines to them are drawn to anchors on their borders, by default. Adding draw=red shows the issue:

issue

The nodes are centred on the path. The lines are drawn to and from their borders.

To avoid this, replace node by coordinate:

coordinates

\documentclass[tikz,border=10pt]{standalone}
\begin{document}
\begin{tikzpicture}[every node/.style={draw=red}]
  \draw (0,0) -- (2,0) node [pos=0.5] (mpa) {};
  \draw (2,0) -- (2,2) node [pos=0.5] (mpb) {};
  \draw (2,2) -- (0,0) node [pos=0.5] (mpc) {};
  \draw (0,0) -- (mpb);
  \draw (2,2) -- (mpa);
  \draw (2,0) -- (mpc);
\end{tikzpicture}
\begin{tikzpicture}
  \draw (0,0) -- (2,0) coordinate [pos=0.5] (mpa);
  \draw (2,0) -- (2,2) coordinate [pos=0.5] (mpb);
  \draw (2,2) -- (0,0) coordinate [pos=0.5] (mpc);
  \draw (0,0) -- (mpb);
  \draw (2,2) -- (mpa);
  \draw (2,0) -- (mpc);
\end{tikzpicture}
\end{document}

EDIT

I don't really understand the follow-up since I don't know where a regular polygon comes in. To mark the intersection, I'd use the intersections library.

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
  \draw (0,0) -- (2,0) coordinate [pos=0.5] (mpa);
  \draw (2,0) -- (2,2) coordinate [pos=0.5] (mpb);
  \draw (2,2) -- (0,0) coordinate [pos=0.5] (mpc);
  \draw [name path=frog] (0,0) -- (mpb);
  \draw [name path=toad] (2,2) -- (mpa);
  \draw (2,0) -- (mpc);
  \path [name intersections={of=frog and toad, name=con}, fill=red] (con-1) circle (1pt);
\end{tikzpicture}
\end{document}

mark intersection

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .