9

I apologize if this question has been asked. I think it should be fairly simple, but I've looked around a bit and I can't find anything that does what I'm looking for.

I know you can calculate, e.g., the point 10% of the way between two nodes:

\node (A) at (0,0) {};
\node (B) at (1,0) {};
\coordinate (C) at ($(A)!0.1!(B)$);

But what if I were drawing a bent line between nodes A and B:

\draw (A) to [bend left=30] (B);

How to I calculate the coordinate that is 10% of the way along this bent path?

Thanks in advance.

7

You can use \path (A) to [bend left=30] coordinate [pos=0.1] (C) (B) to place a coordinate at a specified distance along the path:

\documentclass{article}

\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (A) {A};
\node (B) at (2,0) {B};
\draw (A) to [bend left=30] (B);
\path (A) to [bend left=30] coordinate [pos=0.1] (C) coordinate [pos=0.7] (D) (B) ;
\fill [red] (C) circle [radius=2pt] (D) circle [radius=2pt];
\end{tikzpicture}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.