4

I'd like to recreate the hyperbola in the image. So far I have the beginning, by following the examples in Drawing a hyperbola of a certain eccentricity in TikZ and How to draw an ellipse?, in particular cmhughes', suggestion in the comments of the previous question, but the top ellipse is lacking its upper half.

How can I fix this? Also can I do this using \addplot3?

\begin{tikzpicture}
\def\xm{5}
\def\ym{6.5}
\def\dom{2}

%\def\ecc{1.44022}
\def\ecc{2.3}
\def\a{1}
\def\b{(\a*sqrt((\ecc)^2-1)} 


\begin{axis}[scale=.8,
    hide axis,
    xmin=-\xm,xmax=\xm,
    ymin=-\ym,ymax=\ym]
    \addplot [domain=-\dom:\dom] ({\a*cosh(\x)},{\b*sinh(\x)});
    \addplot [domain=-\dom:\dom] ({-\a*cosh(\x)},{\b*sinh(\x)});

    \draw (0,0) ellipse (.55cm and .25cm);
    \draw (0,6) ellipse (1.3cm and .3cm);
%    \draw (0,-4) ellipse (1.8cm and .3cm);
\end{axis}
\end{tikzpicture}

Required[![][1] Required[![][1]

7

Here is an \addplot3 example you can play with

\documentclass[border=9,tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[hide axis,axis equal]
            \addplot3[surf,domain=0:360,y domain=-2:2]
                ({cosh(y)*cos(x)},{cosh(y)*sin(x)},{sinh(y)});
        \end{axis}
    \end{tikzpicture}
\end{document}

|improve this answer|||||
2

I've tried the excellent approaches suggested but I was not satisfied with my 3D results (thus far). So I'd like to add what I came up with.

\documentclass[12pt,a4paper]{article}

\usepackage[fleqn]{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}

\definecolor{whitesmokedark}{RGB}{235,235,235}
\definecolor{gainsboro}{RGB}{220,220,220}

\begin{document}

\begin{tikzpicture}
\def\xm{5}
\def\ym{10}
\def\df{3}
\def\dom{2}

%\def\ecc{1.44022}
\def\ecc{2.3}
\def\a{1}
\def\b{(\a*sqrt((\ecc)^2-1)} 

\begin{axis}[scale=.8,
    hide axis,
    xmin=-\xm,xmax=\xm,
    ymin=-\ym,ymax=\ym]

    \fill[gainsboro] (0,0) ellipse (.55cm and .2cm);
    \fill[whitesmokedark] (0,7.5) ellipse (2.1cm and .3cm);
    \fill[gainsboro] (0,-7.4) ellipse (2.05cm and .3cm);

    \addplot [domain=-\dom:\dom] ({\a*cosh(\x)},{\b*sinh(\x)});
    \addplot [domain=-\dom:\dom] ({-\a*cosh(\x)},{\b*sinh(\x)});

\end{axis}

\def\xax{2.7}
\draw[dotted] (\xax,\xax - 0.4) -- (\xax,\xax + 1);
\draw[solid, ->] (\xax,\xax + 1) -- (\xax,\xax + 1.7);
\draw[solid, ->] (\xax,\xax - 0.4) -- (1.5,2);
\draw[solid, ->] (\xax,\xax - 0.4) -- (4.5,2);

\node (x) at ( \xax -0.1,\xax + 1.3) [label=right:$x$] {};
\node (y) at (1.6,1.9) [label=above:$y$] {};
\node (z) at (4.5,1.9) [label=above:$z$] {};

\end{tikzpicture}

\end{document}

Which gives the picture below. (Critiques are very welcome.)

Edit The 3D solution:

\documentclass[12pt,a4paper]{article}

\usepackage[fleqn]{amsmath}
\usepackage[usenames, dvipsnames]{color}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}

\definecolor{mediumgreen}{RGB}{0,153,0}

\begin{document}
\begin{tikzpicture}[scale=1.5]
    \begin{axis}[
    shader=interp,
    opacity=0.7,
    fill opacity=0.7,
    axis lines = none,
    ticks=none,
    axis equal
    ]

    \draw[thick,->,black] (0,0,0) -- (4,0,0) node[anchor=north east]{$z$};
    \draw[thick,->] (0,0,0) -- (-1,-6,1) node[anchor=north east]{$y$};
    \draw[thick,->] (0,0,0) -- (0,0,4.3) node[anchor=east]{$x$};

    \addplot3[%
        shader=interp,
        opacity = 0.6,
        fill opacity=0.6,
        surf,
        colormap = {whiteblack}{color(0cm)  = (mediumgreen);color(1cm) =      (black)},
        variable = \u,
        variable y = \v,
        domain = 0:180,
        y domain = 0:360,
    ]
    ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {.1*cos(v)});

    \addplot3[surf,domain=0:360,y domain=-1.5:1.5]
         ({cosh(y)*cos(x)},{cosh(y)*sin(x)},{sinh(y)});

    \end{axis}

\end{tikzpicture}

\end{document}

Hyperbola 3D Hyperbola

|improve this answer|||||

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.