0

I would like to do something similar to the (first) answer to this question, i.e. the MWE given by:

    \documentclass[tikz,border=3pt]{standalone}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}[
  point/.style = {draw, circle, fill=black, inner sep=0.7pt},
]
\def\rad{2cm}
\coordinate (O) at (0,0); 
\coordinate (N) at (0,\rad); 

\filldraw[ball color=white] (O) circle [radius=\rad];
\draw[dashed] 
  (\rad,0) arc [start angle=0,end angle=180,x radius=\rad,y radius=5mm];
\draw
  (\rad,0) arc [start angle=0,end angle=-180,x radius=\rad,y radius=5mm];
\begin{scope}[xslant=0.5,yshift=\rad,xshift=-2]
\filldraw[fill=gray!10,opacity=0.2]
  (-4,1) -- (3,1) -- (3,-1) -- (-4,-1) -- cycle;
\node at (2,0.6) {$P$};  
\end{scope}
\draw[dashed]
  (N) node[above] {$A$} -- (O) node[below] {$O$};
\node[point] at (N) {};
\end{tikzpicture}

\end{document}

This produces:

Tangent Plane to a Sphere

What I would like, however, is to give a comparison between a rotation about e.g. the y-axis of e.g. 60 degrees and the corresponding translation in the tangent plane to A. In other words, I would like to draw a path on the surface of the sphere from A (i.e. the north pole (0,0,1)) to the point (sin(60),0,cos(60)). Moreover, I would like to draw a path in the tangent plane of the same length lying "above" the previous path, i.e. a straight-line path from A to (pi/3,0,1).

My goal is to have an image allowing one to make a comparison between such rotations and the translations sitting "above" them, and how these get closer together as the radius of the sphere gets larger (for the purposes of clearly, explicitly illustrating a simple example of group contractions).

Unfortunately, my unfamiliarity with TikZ has left my attempts at adapting the linked figure for my purposes unfruitful. Any suggestions on a simple way to do something like this?

2
  • Welcome to TeX.SX ! Unfortunately, the example you posted consists entirely of fake 3d. It would make little sense to do computations in this model.
    – marsupilam
    Jun 5, 2017 at 11:04
  • Would there be any other way to do it? I'm not wed to the given example, it just seemed close enough to what I wanted. "Real 3d," whatever that might mean, would be perfectly acceptable as well. Jun 5, 2017 at 11:06

1 Answer 1

4

Hope this gets you started.

I take inspiration from the official pgfplots sphere

The output

enter image description here

The code

\documentclass[tikz, border=2pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\pgfplotsset
{
  mySphere/.style=
  {
    opacity = 0.35,
    surf,
    z buffer = sort,
    samples = 50,
    y samples=25,
    variable = \u,
    variable y = \v,
    domain = 0:180,
  },
}
\begin{tikzpicture}
    \begin{axis}
      [
        axis equal,
        width=10cm,
        height=10cm,
        ticks=none,
        enlargelimits=.2,
        view/h=10,
        scale uniformly strategy=units only,
        axis lines = none,
      ]
      \addplot3 % the background half=sphere
        [
          mySphere,
          y domain = 0:180,
        ]
        ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});

      \def\myAng{60}
      \addplot3
      [
        thick,
        domain=0:\myAng,
        samples y=0,
      ]
      ({sin(x)},{0},{cos(x)});

      \coordinate (A) at ({tan(\myAng)},0,1) ;
      \draw [thick] (0,0,1) node [above] {$A$} -- (A) -- (0,0,0) -- cycle ;

      \addplot3 % the front half-sphere
        [
          mySphere,
          y domain = 180:360,
        ]
        ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});

        \def\h{2}
        \addplot3 [surf, green, opacity=.2,domain=-.8*\h:\h, y domain=-\h:.8*\h,samples=2, marks=none]{1} ;
        \node at (.9*\h,.65*\h,1) {$\mathcal{P}$};

    \end{axis}
\end{tikzpicture}
\end{document}

You must log in to answer this question.

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