# How is arc defined in TikZ?

Several questions about how arc is computed:

1. The start and end angles seem to be defined relative to the y axis, yet in the Tikz manual they are defined relative to the x axis. Is this right?

2. Is the end angle defined between the y (or x) axis and the incoming path, or between the y (or x) axis and the extension of the path beyond the endpoint?

3. Geometrically speaking, providing just the start and end angles (and radius) is not enough to define an arc unambiguously. Is there some other assumption, such as: Arcs must be less than 180 degrees? Or arcs must always curve counterclockwise?

\draw (x,y) arc (start:stop:radius); draws an arc

• with radius radius
• starts from (x,y)
• with center (x-r*cos(start), y-r*sin(start)) and
• ends at (x-r*cos(start)+r*cos(stop), y-r*sin(start)+r*sin(stop)).

For example,

 \draw[red] (0,0) arc (30:60:3);


draws an arc

• of radius 3
• starting from (0,0)
• with center (0-3*cos(30),0-3*sin(30)) and
• ending at (0-3*cos(30)+3*cos(60),0-3*sin(30)+3*sin(60)).
\draw[blue] (0,0) -- ++(30+180:3) -- +(60:3);


draw a blue line to the arc to make a complete sector as shown in the following figure. ## Minimal Working Example

\documentclass[tikz,border=12pt]{standalone}

\begin{document}
\foreach \start/\stop in {30/60,45/90,135/180,0/180,45/315}
{
\begin{tikzpicture}
\draw[lightgray,ultra thin] (-6,-6) grid (6,6);
\draw[red] (0,0) arc (\start:\stop:3);
\draw[blue] (0,0) -- ++(\start+180:3) -- +(\stop:3);
\node[anchor=north] at (0,6) {$(\start:\stop:3)$};
\end{tikzpicture}
}
\end{document}


## Other outputs for you to analyze    • Thank you very much. I was completely confused about the meaning of "start angle" and "end angle". I understand now! ---David B. May 3, 2014 at 17:12
• Just a remark on "(start:stop:radius)": both "(45:315:3)" and "(315:45:3)" draw 3/4 of a disk. To draw the missing 1/4 you need "(315:405:3)".
– jpb
Jan 6, 2017 at 11:16
• @jpb: is there a way to force it to draw clockwise or anticlockwise? In my current application, I don't know what my start and stop angles will be in advance, but I know I want a clockwise arc from start to stop. Sometimes, I need to add 360, and sometimes I need to not. Feb 28, 2018 at 19:14
• After reading this numerous times I cannot figure out how you change the location for the center of the circle with the commands given. Oct 18, 2020 at 22:58
• @PiFisher You use a negative number for the angle, then it rotates clockwise. Jul 12, 2021 at 14:55

For visualisation, here is a diagram: where

• theta_i is the start angle,
• theta_f is the end angle,
• O is the centre of rotation (not the origin),
• A is the starting point,
• B is the end point.

1. The start and end angles seem to be defined relative to the y axis, yet in the Tikz manual they are defined relative to the x axis. Is this right?

The start and end angle are defined with respect to the x-axis. That convention is widespread, so it shouldn't be surprising. Although the tikz manual (v3.0) actually doesn't spell that out anywhere, as far as I know, you can gather as much from the numerous examples that use the arc operation therein.

1. Is the end angle defined between the y (or x) axis and the incoming path, or between the y (or x) axis and the extension of the path beyond the endpoint?

Moreover, you can have arcs that span more than 180 degrees (by having |\theta_f-\theta_i| > 180 degrees) and you can have arcs that curve clockwise (by having \theta_f<\theta_i).