Given the following array of coordinates
\def\points{ (-1, 3) (2, 7) (3, 8) }
(see its use e.g. in TikZ: Smooth curve through three points without changing direction)
how do I
iterate (in
tikz) over the coordinates? e.g."iterate over coordinates" { How to get the coordinate the iterator is pointing to? How to get the iteration index? }address an element directly, e.g. coordinate 2 (i.e. (2, 7)) e.g.
\coordinate (A) at ("second coordinate at \points");
A similar question regarding 2D matrices in tikz is posed at 2D tikz matrices: iteration and addressing elements
\foreach \x/\y in {-1/3, 2/7, 3/8} {...}but, as cfr says, without a minimal working example it's tricky to say whether this is the best approach for you. – Dec 03 '17 at 11:25