# Drawing a circular arc between two rays

I have two rays drawn with a common endpoint at A. I mark a point 3/7 of the way from A to the end of one of the rays, and label it P. I want to draw a circular arc centered at A through P between the rays.

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}

\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\begin{document}

\begin{tikzpicture}

%Three points are labeled in the Cartesian plane.
\coordinate (A) at (0,0);
\coordinate (B) at (75:3);
\coordinate (C) at ($(B) +(5,0)$);

%Two rays are drawn
\draw[name path=path_AB, -latex] (A) -- (B);
\draw[name path=path_AC, -latex] (A) -- (C);

%The four vertices are labeled.
\node at ($(A)! -2.5mm! (C)$){$A$};
\node at ($(B)! -2.5mm! (A)$){$k$};
\node at ($(C)! -2.5mm! (A)$){$\ell$};

%The circular arc centered at A starts at P.
\coordinate (P) at ($(A)!3/7!(B)$);
\draw[fill] (B') circle (1.5pt);

%An arc between the rays starting at P.

\end{tikzpicture}

\end{document}

## Updated

Since you already defined P, you can calculate the length that goes from A to it and then use the updated version of the command you see in the old solution:

%An arc between the rays starting at P.
\draw (P) arc (80:30:\radius) node[pos=0,left] {$P$};

## Old solution

\draw ++(75:1) arc (75:27:1) node[pos=0,left] {$P$};

which does:

• Start from (0,0) (the A coordinate) and move 1 in the direction of the 75 angle
• From there, draw an arc that goes from the angle 75 to the angle 27.1 is the radius.
• Finally, add a node P at the start of the arc, on the left.

## Some explanations

Is the part ++(75:1) compiled the same as (0,0) ++(75:1)?

Yes, it's the same thing.

Why do you have 27 in (75:27:1)?

75 is the starting angle, while 27 is the end angle. These angles are not the angle at which the path exits or enters, here's an image to show what I mean:

• The point P is already given. The desired arc has to pass through P. You answer locates another point P in a position that differs from the actual position of the already existing P. Commented Jul 1, 2015 at 20:42
• @GonzaloMedina Ops. Didn't see that. I'll fix the answer. Commented Jul 1, 2015 at 21:31
• @Alenanno I am not familiar with \pgfmathsetlengthmacro command. Why can't you have \draw (P) arc (80:30:(3/7)*3cm)? Commented Jul 1, 2015 at 22:22
• @user74973 Actually you can, but you need to write it like arc (80:30:{(3/7)*3cm}), with curly braces. Commented Jul 1, 2015 at 22:48
• @user74973 The \pgfmathsetlengthmacro is useful in case you want to reuse the same value, then you just type \radius or whatever name you decide. Commented Jul 1, 2015 at 22:50

Two options.

1. Clipping a circle using the rays:

\begin{scope}
\clip (B) -- (A) -- (C);
\path[draw]
let
\p1=( $(A) - (P)$ )
in
(A) circle ({veclen(\x1,\y1)});
\end{scope}

2. using the angles library:

\path[draw]
let
\p1=( $(A) - (P)$ )
in
\end{tikzpicture}

In both cases, the calc library was used to calculate the radius.

The complete code:

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}

\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\begin{document}

\begin{tikzpicture}

%Three points are labeled in the Cartesian plane.
\coordinate (A) at (0,0);
\coordinate (B) at (75:3);
\coordinate (C) at ($(B) +(5,0)$);

%Two rays are drawn
\draw[name path=path_AB, -latex] (A) -- (B);
\draw[name path=path_AC, -latex] (A) -- (C);

%The four vertices are labeled.
\node at ($(A)! -2.5mm! (C)$){$A$};
\node at ($(B)! -2.5mm! (A)$){$k$};
\node at ($(C)! -2.5mm! (A)$){$\ell$};

%The circular arc centered at A starts at P.
\coordinate (P) at ($(A)!3/7!(B)$);
%\draw[fill] (B') circle (1.5pt);

\node[left] at (P) {$P$};

\begin{scope}
\clip (B) -- (A) -- (C);
\path[draw]
let
\p1=( $(A) - (P)$ )
in
(A) circle ({veclen(\x1,\y1)});
\end{scope}

\path[draw]
let
\p1=( $(A) - (P)$ )
in