[Tex/LaTex] How to draw an elliptical arc in TikZ given only opposite extreme points (vertices) of the ellipse

tikz-pgf

Given two nodes (a) and (b), I would like to draw an elliptical arc from (a) to (b) whose major axis is the segment connecting (a) and (b) (the minor axis can be some arbitrary length). The main difficulty is that this ellipse's axes need not be parallel to the standard coordinate axes. Moreover, I don't know what angle the point (b) is at relative to (a).

What I have done so far is to, within a scope, shift the origin of tikz's coordinate system to the midpoint between (a) and (b), and change the coordinate x-vector to (a), with the plan of just drawing a plain old elliptical arc starting at (1,0) from 0 degrees to 180 degrees in this new coordinate system.

The following example is the picture I'm trying to draw with almost everything stripped away, but I left in how I am making the points (a) and (b) to illustrate why I don't know their coordinates.

\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amssymb,amsthm,amsfonts,graphicx}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.markings,positioning}

\begin{document}
\begin{center}
\begin{tikzpicture}

\draw[postaction={decorate,decoration={markings,
      mark=at position 0.7 with {\node (a) {};}}}]
      (0,0) ellipse (0.6 and 0.4);

\draw[postaction={decorate,decoration={markings,
      mark=at position 0.7 with {\node (b) {};}}}]
      (0,0) ellipse (1.2 and 1);

\node (c) at ($(a)!0.5!(b)$) {};

\begin{scope}[shift={(c)},x={(a)}]
\draw (1,0) arc (0:180:1 and 0.3);
\draw[dashed] (-1,0) arc (180:360:1 and 0.3);
\end{scope}
\end{tikzpicture}
\end{center}
\end{document}

This produces

enter image description here

(I want the ellipse I'm drawing to lie within the annulus, i.e. each extreme point should be tangent to the inner or outer pieces, respectively.)

By way of comparison, if instead of trying to make an ellipse, I just draw a line from (-1,0) to (1,0) in my new coordinate system, by changing the contents of my scope to

\begin{scope}[shift={(c)},x={(a)}]
\draw (-1,0) -- (1,0);
\end{scope}

then things work in the manner I want:

enter image description here

This works because it did not require using any y-coordinates.

Unfortunately, I don't know what vector I should change the coordinate y-vector to. If there is an easy way to determine a perpendicular bisector of the segment connecting (a) and (b), so that I can change the coordinate y-vector to it, that would be great, but I'd appreciate any other approaches to solving this issue.

Best Answer

I think that this problem is quite different that what the title implies. If you are are not doing these kind of figure often, you can just apply a scale=0.7 to yield the desired result:

enter image description here

Code:

\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amssymb,amsthm,amsfonts,graphicx}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.markings,positioning}

\begin{document}
\begin{center}
\begin{tikzpicture}

\draw[postaction={decorate,decoration={markings,
      mark=at position 0.7 with {\node (a) {};}}}]
      (0,0) ellipse (0.6 and 0.4);

\draw[postaction={decorate,decoration={markings,
      mark=at position 0.7 with {\node (b) {};}}}]
      (0,0) ellipse (1.2 and 1);

\node (c) at ($(a)!0.5!(b)$) {};

\begin{scope}[red, shift={(c)},x={(a)}, scale=0.7]
\draw (1,0) arc (0:180:1 and 0.3);
\draw[dashed] (-1,0) arc (180:360:1 and 0.3);
\end{scope}
\end{tikzpicture}
\end{center}
\end{document}