0

I want to draw the two arcs you see in the second picture (Autocad drawing). These two arcs are a portion of these two ellipses, respectively:

Ellipse 1:

  • x radius=10.15
  • y radius=2.15
  • center=(0,0)

Ellipse 2:

  • x radius=14.4221
  • y radius=3.0521
  • center=(0,0)
\documentclass[12pt,twoside,openright]{report}
    
    \usepackage{amsfonts,amssymb,amsmath,float,bm,tikz,subcaption,graphicx,textcomp,gensymb,pgfplots} \usetikzlibrary{patterns}
    
    \begin{document}    
    
    \begin{figure} [H]
        \centering
    
    \begin{tikzpicture}[thick, scale=0.5]
    
    \shadedraw[top color=gray, bottom color=gray!30!white, draw=black] (-5.6082,-4.3226) -- (-5.6082,0) arc(-180:0:5.6082 and 1.1869) -- (5.6082,-4.3226) arc(0:-180:5.6082 and 1.1869);
    \draw[dashed] (-5.6082,0) arc(180:0:5.6082 and 1.1869);
    \draw (-5.6082,0) -- (-5.6082,4.3226);
    \draw (5.6082,0) -- (5.6082,4.3226);
    \draw[teal,arrows=->] (0,0) -- (-10.9211,6.6104) node[pos=1,above=2pt]{$x$};
    \draw[teal,arrows=->] (0,0) -- (-13.0336,-3.2048) node[pos=1,below=2pt]{$y$};
    \draw[teal,arrows=->] (0,0) -- (0,8) node[pos=1,right=2pt]{$z$};
    \draw[violet,arrows=->] (0,0) -- (-11.8797,3.0548) node[pos=1,above=2pt]{$r$};
    \draw[violet,arrows=->] (-3.5638,0.9164) -- (-12.8766,-0.9233) node[pos=1,above=2pt]{$\theta$};
    \draw[violet,arrows=->] (0,0) -- (11.8797,-3.0548) node[pos=1,above=2pt]{$r$};
    \draw[violet,arrows=->] (3.5638,-0.9164) -- (12.8766,0.9233) node[pos=1,above=2pt]{$\theta$};
    \node[circle,fill,inner sep=2pt,label=below:{$\textbf{A}$}] at (-3.5638,0.9164){};
    \node[circle,fill,inner sep=2pt,label=above:{$\textbf{B}$}] at (3.5638,-0.9164){};
    \draw (-3.3527,2.0293) arc (149:166:10.15 and 2.15);
    \draw (-4.7599,2.8811) arc (149:346:14.4221 and 3.0521);
    \end{tikzpicture}
    % \caption{Sistema brazo-flotador}
    % \label{fig:sistema_brazo_flotador}
    \end{figure} 
    \end{document}

Arc obtained:

Arc obtained

Expected arc:

Expected arc

4
  • 1
    Please post minimal but compilable code showing your problem. Please also describe what you want. Right not the only answer you can get is: Partial ellipse with arc function does work Commented Mar 2, 2022 at 11:32
  • Change the line \draw (-3.3527,2.0293) arc (149:166:10.15 and 2.15); in \draw (-3.3527,2.0293) arc (149:172:10.15 and 2.15); Commented Mar 2, 2022 at 12:12
  • Yeah, but it does not follow the form of an ellipse. I want it to do that. Thanks anyway.
    – el_maxx
    Commented Mar 2, 2022 at 12:15
  • Note that circles and ellipses are draw relative to their centers, but arcs are draw relative to their starting point (r: \theta). Commented Mar 2, 2022 at 22:47

1 Answer 1

1

As the figure is auto generated, it is really hard to make sense of the coordinates and angles. -so I just guessed the angles involved. For a better result, it would be easier to start over and use polar coordinates when needed.

\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}[thick, scale=0.5]
\draw (-3.3527,2.0293) arc[start angle=110, delta angle=20, x radius=10.15, y radius=2.15];
\draw (-4.7599,2.8811) arc[start angle=110, delta angle=20, x radius=14.4221, y radius=3.0521];
\shadedraw[top color=gray, bottom color=gray!30!white, draw=black] (-5.6082,-4.3226) -- (-5.6082,0) arc(-180:0:5.6082 and 1.1869) -- (5.6082,-4.3226) arc(0:-180:5.6082 and 1.1869);
\draw[dashed] (-5.6082,0) arc(180:0:5.6082 and 1.1869);
\draw (-5.6082,0) -- (-5.6082,4.3226);
\draw (5.6082,0) -- (5.6082,4.3226);
\draw[teal,arrows=->] (0,0) -- (-10.9211,6.6104) node[pos=1,above=2pt]{$x$};
\draw[teal,arrows=->] (0,0) -- (-13.0336,-3.2048) node[pos=1,below=2pt]{$y$};
\draw[teal,arrows=->] (0,0) -- (0,8) node[pos=1,right=2pt]{$z$};
\draw[violet,arrows=->] (0,0) -- (-11.8797,3.0548) node[pos=1,above=2pt]{$r$};
\draw[violet,arrows=->] (-3.5638,0.9164) -- (-12.8766,-0.9233) node[pos=1,above=2pt]{$\theta$};
\draw[violet,arrows=->] (0,0) -- (11.8797,-3.0548) node[pos=1,above=2pt]{$r$};
\draw[violet,arrows=->] (3.5638,-0.9164) -- (12.8766,0.9233) node[pos=1,above=2pt]{$\theta$}; \node[circle,fill,inner sep=2pt,label=below:{$\textbf{A}$}] at (-3.5638,0.9164){}; \node[circle,fill,inner sep=2pt,label=above:{$\textbf{B}$}] at (3.5638,-0.9164){};
\end{tikzpicture}
\end{document}

Cylinder in coordinate system

1
  • Thank you a lot! It keeps being a mystery for me how I can determine the start angle (in this case 110 degrees) without guessing.
    – el_maxx
    Commented Mar 2, 2022 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .