I'm trying to draw the arc of an ellipse which is centered at the origin. I'd like it to start drawing at an initial angle of 45 degrees and end at 90 degrees.
From this question on this site, there is a comment that indicates one way to do it is
\documentclass{article}
\usepackage{tikz}
\usepackage[dvipsnames]{xcolor}
\begin{document}
\begin{tikzpicture}
\draw[fill=ProcessBlue!30] (45:2cm and 1cm) arc [start angle = 45.0, end angle=90.0, x radius = 2cm, y radius = 1cm];
\end{tikzpicture}
\end{document}
which produces
Unless I am being stupid, this doesn't appear to actually be the drawing at the angle of 45 degrees relative to the horizontal. The coordinates of that point are (r*cos(pi/4), r*sin(pi/4))
, where r
is calculated using this formula from wikipedia. That point is outlined in red below. I also drew a line from the origin to show that that point is calculated correctly.
Here's what I used to make the above.
\documentclass{article}
\usepackage{tikz}
\usepackage[dvipsnames]{xcolor}
\begin{document}
\begin{tikzpicture}
\draw (-4,0) -- (4,0);
\draw (0,-4) -- (0,4);
\draw[fill=blue] (45:2cm and 1cm) circle (0.05cm);
\draw[fill=ProcessBlue!30] (45:2cm and 1cm) arc [start angle = 45.0, end angle=90.0, x radius = 2cm, y radius = 1cm];
\draw[fill=red] (0.894427190999916, 0.894427190999916) circle (0.05cm);
\draw[dashed] (0,0) ellipse (2cm and 1cm);
\draw (0,0) -- (1,1);
\end{tikzpicture}
\end{document}
My question: It appears that the command \draw[fill=ProcessBlue!30] (45:2cm and 1cm) arc...
is NOT drawing an arc which starts from the point on the ellipse with axes 2cm
and 1cm
, that makes a 45 degree angle with the horizontal (Confusingly, that IS how one would do it for a circle...). I think this is the first time I've found TikZ syntax to be so wildly off of what I'd naturally expect. So, what is it actually doing (i.e., why did it start at the blue point)? Is there a simple way to do what I originally aimed to do (I emphasize simple because what I want to do is not very advanced.)?
\draw[fill=blue] (63.43:2cm and 1cm) circle (0.05cm);
. You want 45 degrees in the 2x stretched ellipse coordinates. So you want the angle associated with atan(1/2), not atan(1), which is 26.5 degrees. But we want the complement, which is 63.43 deg