1

I want to be able to draw a picture like this. I followed this answer

pgfplots quadrics But I am unable to draw the intersecting plane. Any insights would be helpful. Thanks in advance!

enter image description here

  • 2
    Welcome! Questions of this type often get answered late, or not at all. Can you show us what you have tried? Also what is the intersection with the hyperboloid at bottom is? A parabola? –  Apr 16 '20 at 03:42
  • 2
    Also, the title "How do you draw a figure like this?" is not very explicit and will draw little attention to this question, consider changing it – BambOo Apr 16 '20 at 07:33
  • Hi @BambOo Thank you for the information. I will keep that in mind the next time I pose a question like this. :) – AdaMStrange Apr 16 '20 at 13:38

1 Answers1

7

This is a start. You need to decompose the plot into pieces. In order to cut the plot with a plane, often clipping gives better results than filters or restrict expr to domain because the latter tend to give "pixelated" borders.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\begin{tikzpicture}
\begin{axis}[hide axis,shader=interp,fill opacity=0.6,
    axis equal image,scale=3,view/el=12,view/az=20,
    declare function={alpha=-25;}]
 \addplot3[surf,domain=-2:2,domain y=90:180+\pgfkeysvalueof{/pgfplots/view/az},colormap/viridis]
  ({sqrt(x*x+1)*cos(y)},{sqrt(x*x+1)*sin(y)},x); 
 \addplot3[surf,domain=0:1,domain y=90:270,colormap/hot]
  ({x*cos(y)},{x*sin(y)},x*x+1); 
 \addplot3[ultra thick,domain=-1:1,samples y=1]  ({0},{x},x*x+1);
 \begin{scope}  
  \clip[overlay] plot[variable=\x,domain=-2.1:2.2]
  ({\x*cos(alpha)+sin(alpha)},{-\x*sin(alpha)+cos(alpha)},{-sqrt(1.25+\x*\x)})
   -| (current axis.north east)  -- (current axis.north west) |- cycle;
  \addplot3[surf,domain=-2:2,domain y=180+\pgfkeysvalueof{/pgfplots/view/az}:270,colormap/viridis]
   ({sqrt(x*x+1)*cos(y)},{sqrt(x*x+1)*sin(y)},x); 
 \end{scope} 
 \fill[gray!40](0,{sqrt(5)},2) -- (0,{-sqrt(5)},2) -- (0,{-sqrt(5)},-2)
  -- (0,{sqrt(5)},-2) --cycle;
 \addplot3[surf,domain=-2:2,domain y=90:\pgfkeysvalueof{/pgfplots/view/az},colormap/viridis]
  ({sqrt(x*x+1)*cos(y)},{sqrt(x*x+1)*sin(y)},x);
 \path ({cos(\pgfkeysvalueof{/pgfplots/view/az})},{sin(\pgfkeysvalueof{/pgfplots/view/az})},0) coordinate (dot);  
 \draw[very thick,-latex] (0,0,0) -- (dot); 
 \addplot3[surf,domain=0:1,domain y=90:-90,colormap/hot]
  ({x*cos(y)},{x*sin(y)},x*x+1); 
 \begin{scope}  
  \clip[overlay] plot[variable=\x,domain=-2.1:2.2]
  ({\x*cos(alpha)+sin(alpha)},{-\x*sin(alpha)+cos(alpha)},{-sqrt(1.25+\x*\x)})
   -| (current axis.north east)  -- (current axis.north west) |- cycle;
  \addplot3[surf,domain=-2:2,domain y=\pgfkeysvalueof{/pgfplots/view/az}:-90,colormap/viridis]
   ({sqrt(x*x+1)*cos(y)},{sqrt(x*x+1)*sin(y)},x); 
 \end{scope}  
 \path (dot)  node[circle,fill,inner sep=1.2pt]{};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

  • "This is a start"? :P – Alenanno Apr 16 '20 at 07:26
  • @Alenanno Not all starts are the same. ;-) –  Apr 16 '20 at 07:38
  • Hi @Schrödinger's cat Thank you for the information. I was referring to this paper on Integral Geometry and Kinematic Space, the figure shows the Poincare Upper half plane model and the outer figure is the de Sitter space. The geodesics on the upper half plane model corresponds to pair of anti-pedal points on the de sitter space formed by the normal of the plane which intersects the de Sitter space at the origin. – AdaMStrange Apr 16 '20 at 13:37
  • I think this solves my problem @Schrödinger's cat! Thank you for your time and your answer! – AdaMStrange Apr 16 '20 at 13:40
  • Hi @Schrödinger'scat I would want to use your code to recreate this figure. How should I properly attribute/cite this? – AdaMStrange Apr 16 '20 at 14:20
  • 1
    @AdaMStrange Thanks for asking but there is no need to cite this. –  Apr 16 '20 at 15:51