# Using the veclen option in the calc package

I would like to draw a circle about point P = (-2.75,0.75) so that a vertex A = (0,0) of a rectangle is on the circumference, and I would like to draw a circle about P of a radius equal to twice the distance between P and A. I tried using the code

 \draw[green, dashed, name path=another_path_to_locate_R] let \p1=($(P)-(0,0)$) in (P) circle (2*{veclen(\x1,\y1)});


and

 \draw[green, dashed, name path=another_path_to_locate_R] let \p1=($(P)-(0,0)$) in (P) circle ($2*{veclen(\x1,\y1)}$); .


I got errors

\documentclass{amsart}

\usepackage{tikz}
\usetikzlibrary{calc,positioning,intersections,quotes}

\begin{document}

\begin{tikzpicture}

\noindent \hspace*{\fill}
\begin{tikzpicture}

\coordinate (A) at (0,0);

\coordinate (P) at (-2.25,0.75);

\draw[name path=another_circle_about_P] let \p1=($(P)-(0,0)$) in (P) circle ({veclen(\x1,\y1)});
%\draw[green, dashed, name path=another_path_to_locate_R] let \p1=($(P)-(0,0)$) in (P) circle ($2*{veclen(\x1,\y1)}$);

\end{tikzpicture}

\end{document}


Just remove the dollar signs, and move * to right before veclen.

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (P) at (-2.25,0.75);
\draw[name path=another_circle_about_P] let \p1=($(P)-(0,0)$) in (P) circle ({veclen(\x1,\y1)});
\draw[green, dashed, name path=another_path_to_locate_R] let \p1=($(P)-(0,0)$) in (P) circle ({2*veclen(\x1,\y1)});
\end{tikzpicture}
\end{document}


# A different way

One quite easy way of drawing a circle around one point, passing through another, is with the help of the through library. It defines one key, circle through, and does exactly that job.

The second circle is drawn using let, from the calc library.

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{through,calc}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (P) at (-2.25,0.75);

• Do you know why the command that I issued to draw the circle about P of radius twice the distance between P and A=(0,0) could not be compiled? Dec 10, 2015 at 20:27