8

Only top portion of half my hyperbola is coming in correctly. The other half is doing something strange:

enter image description here

\documentclass{article}
\usepackage{tikz, pgf}
\begin{document}
\begin{center}
  \begin{tikzpicture}
    \begin{scope}
      \clip (0,-3) rectangle (4,3);
      \draw [samples = 50, domain = -0.99:0.99,
      rotate around = {0:(0,0)}, xshift = 0cm, yshift = 0cm]
      plot ({0.69*(1+\x^2)/(1-\x^2)}, {0.72*2*\x/(1-\x^2)});
    \end{scope}
  \end{tikzpicture}
\end{center}
\end{document}
jub0bs
  • 58,916
dustin
  • 18,617
  • 23
  • 99
  • 204
  • You tagged this as pgfplots but not using it. Compare the difference \begin{tikzpicture}\begin{axis}\addplot [samples = 50, domain = -0.99:0.99] ({0.69*(1+\x^2)/(1-\x^2)}, {0.72*2*\x/(1-\x^2)});\end{axis}\end{tikzpicture} – percusse Apr 15 '13 at 23:50

2 Answers2

10

Substituting \x*\x or (\x)^2 for \x^2 fixes your problem.

enter image description here

\documentclass{article}
\usepackage{tikz, pgf}
\begin{document}
\begin{center}
  \begin{tikzpicture}
    \begin{scope}
      \clip (0,-3) rectangle (4,3);
      \draw [samples = 50, domain = -0.99:0.99,
      rotate around = {0:(0,0)}, xshift = 0cm, yshift = 0cm]
      plot ({0.69*(1+\x*\x)/(1-\x*\x)}, {0.72*2*\x/(1-\x*\x)});
    \end{scope}
  \end{tikzpicture}
\end{center}
\end{document}
jub0bs
  • 58,916
6

With PSTricks.

enter image description here

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-math}
\def\X(#1){COSH(#1)}
\def\Y(#1){SINH(#1)}
\psset{algebraic}
\begin{document}
\begin{pspicture}(-6,-4)(6,4)
    \psaxes{->}(0,0)(-6,-4)(5.5,3.5)[$x$,0][$y$,90]
    \psset{linecolor=blue}
    \psparametricplot{-2}{2}{\X(t)|\Y(t)}
    \psparametricplot{-2}{2}{-\X(t)|\Y(t)}
\end{pspicture}
\end{document}
  • In this case, I don't know if a pstricks answer is really an appropriate alternative. The question was really about a specific bug in tikz. – Ryan Reich Apr 16 '13 at 01:09
  • 1
    @RyanReich: While the bug is being fixed, we can use it temporarily for emergency solution or permanently. – kiss my armpit Apr 16 '13 at 01:13
  • 3
    Well, the workaround is pretty simple (just use parentheses). Anyway, I'm not criticizing your answer, just musing on the purpose of adding a package-alternative answer to a question that is not general enough to be answered by an alternative package. This topic was recently raised in Meta, so it was on my mind. – Ryan Reich Apr 16 '13 at 01:16