I'd like to draw a set of lines between some set of points, and on the 1/3 and 2/3 point of each line I'd like to draw a vertical line. In order to do this I first defined the points, and then wanted to use a \foreach loop to draw. However it seems that the foreach loop does not work with calc:
The following code describes what I want to do. The problem is that the expression ($0.333*\x + 0.666*\y$) within the for loop does seem to cause problems. (While e.g. ($0.333*(A) + 0.666*(B)$) works.) Can anyone tell me what I'm doing wrong/what I need to change in order to make this work?
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{patterns}
\usetikzlibrary{calc}
\usetikzlibrary{arrows.meta}
\usepackage{ifthen}
\begin{document}
\begin{center}
\begin{tikzpicture}
\coordinate (A) at (-3,1);
\coordinate (B) at (3,3);
\coordinate (C) at (0,3);
\foreach \x/\y in {(A)/(B),(B)/(C),(A)/(C)}{
\draw[-] \x -- \y;
\draw[dashed] ($0.333*\x + 0.666*\y$) -- +(0,1);
\draw[dashed] ($0.666*\x + 0.333*\y$) -- +(0,1);
}
\end{tikzpicture}
\end{center}
\end{document}

