# (TikZ) Comparison of Path on Sphere to Associated Path in the Tangent Plane

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},
]
\coordinate (O) at (0,0);

\draw[dashed]
\draw
\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: 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?

• 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 '17 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. – OperaticDreamland Jun 5 '17 at 11:06

Hope this gets you started.

I take inspiration from the official pgfplots sphere

## The output ## 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,
]
[
mySphere,
y domain = 0:180,
]
({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});

\def\myAng{60}
[
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 ;

[
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}