6

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}

1 Answer 1

5

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

enter image description here

\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.

enter image description here

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{through,calc}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (P) at (-2.25,0.75);
\fill (A) circle[radius=2pt] (P) circle[radius=2pt];
\node [draw,circle through={(A)}] at (P) {};
\draw
let
 \p1=(A), \p2=(P), \n1={2*veclen(\y2-\y1,\x2-\y1)}
in
(P) circle[radius=\n1];
\end{tikzpicture}
\end{document}
3
  • 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?
    – user74973
    Dec 10, 2015 at 20:27
  • @user74973 I just updated my answer. Dec 10, 2015 at 20:28
  • Yep. I posted my comment as you were updating your answer. And your update anticipated my question. Thanks.
    – user74973
    Dec 10, 2015 at 20:30

You must log in to answer this question.

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