# TikZ: using the ellipse command with a start and end angle instead of an arc

Consider the code below:

\documentclass[convert = false]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
\draw[-latex] (0, 0) ellipse [x radius = 3cm, y radius = 2cm, start angle = 30,
end angle = 150];
\end{tikzpicture}
\end{document}


This code produces no compiling errors but it doesn't acknowledge the start and angle or the arrow option. I could use the command arc, but then to have the arc centered at the origin, I would need to define the arc starting coordinate as

\coordinate (P) at ($(0, 0) + (30:3cm and 2cm)$);


And then draw the arc:

\documentclass[convert = false]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\draw[-latex] (0, 0) ellipse [x radius = 3cm, y radius = 2cm,
start angle = 30, end angle = 150];

\coordinate (P) at ($(0, 0) + (30:3cm and 2cm)$);

\draw[thick, red, -latex] ($(0, 0) + (30:3cm and 2cm)$(P) arc
(30:150:3cm and 2cm);
\end{tikzpicture}
\end{document}


This isn't terribly difficult but is there a way to use the ellipse command to achieve the desired result?

• The ellipse command always draws a full ellipse, so unless you're willing to clip it, that's not the way to go. You don't need all that \coordinate and calc stuff for the arc, though: Just use \draw[thick, red, -latex] (30:3cm and 2cm) arc (30:150:3cm and 2cm);. The definition of your coordinate (($(0, 0) + (30:3cm and 2cm)$)) doesn't really make sense: It's perfectly equivalent to just saying (30:3cm and 2cm) (you're simply adding 0 to the coordinates).
– Jake
Commented Jul 8, 2013 at 19:54
• @Jake I don’t think the problem here is the use of calc but that to draw an arc around a coordinate you need to evaluate/input start angle and radii twice. Commented Jul 8, 2013 at 22:26
• @Qrrbrbirlbel: Possibly. I wasn't sure from the question (hence the comment), but I am sure that the ($(0, 0) + (30:3cm and 2cm)$) syntax is unnecessary.
– Jake
Commented Jul 8, 2013 at 22:28
• Commented Nov 10, 2013 at 3:09
• Use this for better readability: arc[start angle=0, end angle=\angle, x radius=2, y radius=2] Commented Oct 29, 2023 at 15:16

You can define a new style that automates setting the start coordinate and drawing the arc:

\tikzset{
partial ellipse/.style args={#1:#2:#3}{
insert path={+ (#1:#3) arc (#1:#2:#3)}
}
}


Then you can simply say

\draw[thick, red, -latex] (0,0) [partial ellipse=30:150:3cm and 2cm];


to draw the arc:

Apart from defining a custom to path or an insert path solution, one could re-define the way TikZ draws its arc. For that, I add the key arc starts that accepts three choices:

• at last point: this is the default behavior,
• after moveto: the arc starts after a move to from the current position (which is the center of the arc),
• after lineto: the arc starts after a line to from the current position (which is the center of the arc).

This implementation does only affect the arc [ ] syntax, though.

The advantage of settings this up as a key is that it can be applied to a scope or to a path and can be used inside other styles.

## Code

\documentclass[tikz]{standalone}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\tikz@arc@opt}{\xdef}{\tikz@arc@do\xdef}{}{}
\let\tikz@arc@do\relax
\tikzset{
arc starts/.cd, .is choice,
at last point/.code=\let\tikz@arc@do\relax,
after moveto/.code=\tikz@arc@do@\pgfpathmoveto,
after lineto/.code=\tikz@arc@do@\pgfpathlineto}
\def\tikz@arc@do@#1{%
\def\tikz@arc@do{\tikz@@@parse@polar{\tikz@arc@do@@#1}(\tikz@s%
\makeatother
\begin{document}
\coordinate (C) at (rand,rand);
\draw[ultra thick] (C) ellipse [];
\draw[green]   ([shift=(30:1 and .6)] C)
arc [start angle=30,   end angle=150];
\draw[red]     (C) -- ++ (180:1 and .6)
arc [start angle=180, delta angle=70] -- cycle;
\draw[blue!50] (C)    ++ (270:1 and .6)
arc [start angle=270, delta angle=80] -- cycle;
\end{tikzpicture}

\begin{tikzpicture}[x radius=1, y radius=.6, arc starts=after moveto]
\coordinate (C) at (rand,rand);
\draw[ultra thick] (C) ellipse [];
\draw[green]   (C) arc [start angle= 30, end   angle=150];
\draw[red]     (C) arc [arc starts=after lineto,
start angle=180, delta angle= 70] -- cycle;
\draw[blue!50] (C) arc [start angle=270, delta angle= 80] -- cycle;
\end{tikzpicture}
\end{document}