5

The following line

\foreach \x / \y in {0.422201/1.000000,1.000000/2.368540}
  {\draw[very thin] (0,0) ellipse (\x and \y)};

gives

ERROR: Package PGF Math Error: Unknown operator `a' or `an' (in '0.422201and 1.000000').

Then I tried (\x{} and \y) as it looked like a space problem, but that doesn't work either.

ERROR: Undefined control sequence.

--- TeX said ---
\pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@ 

l.10 ...aw[very thin] (0,0) ellipse (\x{} and \y)}

Here's the document

\documentclass{article}
\usepackage{tkz-euclide}
\begin{document}

\begin{tikzpicture}
  \begin{scope}
    \clip (-1.5,-1.5) rectangle (4,4);
    \begin{scope}[rotate=12.549]
      \foreach \x / \y in {0.422201/1.000000,1.000000/2.368540}
        {\draw[very thin] (0,0) ellipse (\x and \y)};
      % \draw[very thin] (0,0) ellipse (0.422201 and 1.000000);
      % \draw[very thin] (0,0) ellipse (1.000000 and 2.368540);
      \draw[very thin] (0,0) ellipse (1.349721 and 3.196868);
      \draw[very thin] (0,0) ellipse (1.625882 and 3.850967);
      \draw[very thin] (0,0) ellipse (1.861515 and 4.409073);
      \draw[very thin] (0,0) ellipse (2.070504 and 4.904071);
    \end{scope}
  \end{scope}
\end{tikzpicture}

\end{document}

and the intended result

concentric ellipses

4

You have to enclose the \x and \y (better be safe) inside braces for the space after \x is swallowed making it 0.422201and. Further, you have to put ; inside the closing brace in

  {\draw[very thin] (0,0) ellipse ({\x} and {\y});}

With these,

\documentclass{article}
\usepackage{tkz-euclide}
\begin{document}

\begin{tikzpicture}
  \begin{scope}
    \clip (-1.5,-1.5) rectangle (4,4);
    \begin{scope}[rotate=12.549]
      \foreach \x / \y in {0.422201/1,1/2.368540,1.349721/3.196868,1.625882/3.850967,1.861515/4.409073,2.070504/4.904071}
        {\draw[very thin] (0,0) ellipse ({\x} and {\y});
        }      
    \end{scope}
  \end{scope}
\end{tikzpicture}

\end{document}

enter image description here

3

You could use the alternative syntax for ellipses which is:

% arara: pdflatex

\documentclass{article}
\usepackage{tikz}

\begin{document}    
\begin{tikzpicture}
    \begin{scope}
        \clip (-1.5,-1.5) rectangle (4,4);
        \begin{scope}[rotate=12.549]
            \foreach \x/\y in {0.422201/1.000000,1.000000/2.368540,1.349721/3.196868,1.625882/3.850967,1.861515/4.409073,2.070504/4.904071}
            \draw[very thin] (0,0) ellipse [x radius=\x,y radius=\y];
        \end{scope}
    \end{scope}
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.