1

How do I change my grey arrows (linking my two axes) from linear to hyperbolic?

enter image description here

\documentclass[float=false,crop=true,dvipsnames]{standalone}

\usepackage{bm}
\usepackage{tikz}
\usetikzlibrary{calc,3d}
\usetikzlibrary{decorations.pathreplacing,calligraphy}

\tikzset{every picture/.style={thick,
                               >=stealth,
                               decoration={calligraphic brace,
                                           amplitude=3pt,
                                           raise=4pt}
                              }}

\begin{document}
\begin{center}
\begin{tikzpicture}[x={(10:.9cm)},y={(90:1cm)},z={(-45:.84cm)}]
    \draw [->] (-2, 0, 0) coordinate (N2)
            -- (-1, 0, 0) coordinate (N1)
            -- ( 0, 0, 0) coordinate (0)
            -- ( 1, 0, 0) coordinate (P1)
            -- ( 2, 0, 0) coordinate (P2)
            -- ( 3, 0, 0) coordinate (P3)
            -- ( 5, 0, 0) coordinate (out);

    \draw [->](-2.4,0, 1) coordinate (N2B)
            --( -2, 0, 1) coordinate (N2A)
            --(-1.2,0, 1) coordinate (N1B)
            --( -1, 0, 1) coordinate (N1A)
            -- ( 0, 0, 1) coordinate (0AB)
            -- ( 1, 0, 1) coordinate (P1A)
            -- (1.2,0, 1) coordinate (P1B)
            -- ( 2, 0, 1) coordinate (P2A)
            -- (2.4,0, 1) coordinate (P2B)
            -- ( 3, 0, 1) coordinate (P3A)
            -- (3.6,0, 1) coordinate (P3B)
            -- ( 6, 0, 1);

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \fill (0)  circle (1.5pt);
    \fill (P1) circle (1.5pt);
    \fill (P2) circle (1.5pt);
    \fill (P3) circle (1.5pt);

    \draw [dashed,RoyalBlue] (0,0,0) -- (0,.5,0);
    \draw [dashed,RoyalBlue] (2.4,0,0) -- (2.4,.5,0);

    \draw (P2) circle (2.5pt);

    \draw [->,ultra thick,RoyalBlue] (0,0,0) -- (2.4,0,0);
    \draw [decorate,pen colour={RoyalBlue},ultra thick] (0,.5,0) -- node[sloped,above=6pt,RoyalBlue]{$\bm{\;a'}$} (2.4,.5,0);

    \draw [->,ultra thick,RoyalBlue] (0,0,0) -- (2,0,0);
    \draw [decorate,pen colour={RoyalBlue},ultra thick] (0,0,0) -- node[sloped,above=6pt,RoyalBlue]{$\bm{a}$} (2,0,0);

    \draw [->,ultra thick,Mahogany] (0,-.05, 0) -- (1.2,-.05,0);
    \draw [decorate,decoration={mirror},pen colour={Mahogany},ultra thick] (0,-.05, 0) -- node[sloped,below=4pt,Mahogany]{$\bm{b}$} (1.2,-.05, 0);

    \draw [->,dashed,RoyalBlue] ($(P2B)-(0,0,.5)$) -- ($(P2B)-(0,0,1.2)$);

    \draw (0) circle (2.5pt);

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \draw [dashed,Gray] (N1) -- (N1A);
    \draw [dashed,Gray] (0)  -- (0AB);
    \draw [dashed,Gray] (P1) -- (P1A);
    \draw [dashed,Gray] (P2) -- (P2A);
    \draw [dashed,Gray] (P3) -- (P3A);

    \draw (P2B) circle (2.5pt);
    \draw (0AB) circle (2.5pt);

    \fill (0AB) circle (1.5pt);
    \fill (P1B) circle (1.5pt);
    \fill (P2B) circle (1.5pt);
    \fill (P3B) circle (1.5pt);

    \draw [->,Gray] (N1) -- (N1B);
    \draw [->]      (0)  -- (0AB);
  % \draw [->, Mahogany] ($(P1B)-(0,0,1)$) -- (P1B);
  % \draw [->,RoyalBlue] (P2B) -- ($(P2B)-(0,0,1)$);
    \draw [->,Gray] (P1) -- (P1B);
    \draw [->,Gray] (P2) -- (P2B);
    \draw [->,Gray] (P3) -- (P3B);

    \draw [->,ultra thick,RoyalBlue] (0,0,1) -- (2.4,0,1);
    \draw [decorate,decoration={mirror},pen colour={RoyalBlue},ultra thick] (0,0,1) -- node[sloped,below=6pt,RoyalBlue]{$\bm{a}$} (2.4,0,1);
\end{tikzpicture}
\end{center}
\end{document}

Hyperbolas tend to look like this:

When y=0 the curve is perpendicular to the x axis. And then curves from there.

enter image description here

Matt
  • 407
  • see if \draw [->,Gray] (P1) to [band left] (P1B); or \draw [->,Gray] (P1) to [band right] (P1B); gives what you like to have. – Zarko Feb 13 '20 at 10:13
  • It does indeed bend like that, however not in a truly hyperbolic way. This way it bends across the dashed lines, which I don't want. – Matt Feb 13 '20 at 10:17
  • What if I plotted the arrows as hyperbolic functions and added an arrow tip at the end of the plot? – Matt Feb 13 '20 at 10:19
  • 1
    Wel, I understood, that this is just a sketch, not an precise plan. you can change bending angle (default is 30 degree). However, a sketch, what you like to have would be very helpful. You can also try for example with draw [->,Gray] (P1) to [out=60, in=45] (P1B); (select angle according your wish). – Zarko Feb 13 '20 at 10:25
  • I've attached a sketch just now. (Edit: except that y should have been a z because I'm using 3D coordinates :P) – Matt Feb 13 '20 at 10:33
  • I'm currently looking at this: https://tex.stackexchange.com/q/158968/183025 – Matt Feb 13 '20 at 10:40

1 Answers1

2

It turns out I can indeed just \draw a bunch of plot()s with the hyperbolic function cosh(\x/1.625) (\x is divided by 1.625 here because that just happened to adjust it to intersecting with the points on the second axis I drew).

    \draw [->,help lines,Gray,domain=0:2,samples=20+1,smooth,variable=\x] plot({-1*cosh(\x/1.625)}, {0}, {\x});
    \draw [->,help lines,Gray,domain=0:2,samples=20+1,smooth,variable=\x] plot({ 1*cosh(\x/1.625)}, {0}, {\x});
    \draw [->,help lines,Gray,domain=0:2,samples=20+1,smooth,variable=\x] plot({ 2*cosh(\x/1.625)}, {0}, {\x});
    \draw [->,help lines,Gray,domain=0:2,samples=20+1,smooth,variable=\x] plot({ 3*cosh(\x/1.625)}, {0}, {\x});

enter image description here

Matt
  • 407