[Tex/LaTex] TikZ: using the ellipse command with a start and end angle instead of an arc

arrowstikz-pgf

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}

enter image description here

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}

enter image description here

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

Best Answer

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:

Related Question