1

I'm trying to modify the below code and use it in beamer instead of standalone, however, when I switch the document class to beamer I get an error "illegal parameter number..this part of the code is giving the error

  \newcommand{\positionXOnEl}[3]{%
    \pgfmathsetmacro{#1}%
      {\figYOrigin+#2*%
      \figBEll*((1-#3^2/\figAEll^2)^2)^(0.25)}}
  \newcommand{\positionYOnEl}[3]{%
    \pgfmathsetmacro{#1}%
      {#2*((\figBEll^2-\figYOrigin^2+2*\figYOrigin*#3-#3^2)^2)^(0.25)*(\figAEll/\figBEll)}}

although it is only a new command.

 %\documentclass[tikz]{standalone}
\documentclass[9pt,aspectratio=169,xcolor=table]{beamer}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{tikz-3dplot}

\pgfplotsset{compat=1.14} \tikzset{>=latex}

\begin{document} \begin{frame} % !TEX root = ../main.tex \tdplotsetmaincoords{60}{100} \begin{tikzpicture}[scale=0.75,tdplot_main_coords] % DEFINITIONS % figOmegaRotation : Value for the Omega angle \pgfmathsetmacro{\figOmega}{33} % figIRotation : value for inclination of the orbital plane \pgfmathsetmacro{\figIRotation}{30} % \figAEll : minimum value for ellipse \pgfmathsetmacro{\figAEll}{2.5} % \figBEll : minimum value for ellipse \pgfmathsetmacro{\figBEll}{3} % figYOrigin : focus of the ellipse with 2.5 and 3 \pgfmathsetmacro{\figYOrigin}{sqrt(\figBEll^2 - \figAEll^2)} % sqrt(b^2 - a^2)

% COMMANDS % \positionOnEl{\storing}{\quadrant}{\x} % Saves into \storing the position \y on the ellipse % specified by \figAEll and \figBEll. \quadrant should help % in defining the quadrant (must be +1 or -1) \newcommand{\positionXOnEl}[3]{% \pgfmathsetmacro{#1}% {\figYOrigin+#2% \figBEll((1-#3^2/\figAEll^2)^2)^(0.25)}} \newcommand{\positionYOnEl}[3]{% \pgfmathsetmacro{#1}% {#2((\figBEll^2-\figYOrigin^2+2\figYOrigin#3-#3^2)^2)^(0.25)(\figAEll/\figBEll)}}

\end{tikzpicture}

\end{frame}

\end{document}

Diana
  • 1,285
  • 7
  • 12

0 Answers0