meta:texrender-examples-2
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| meta:texrender-examples-2 [August 13, 2026 at 18:03] – created Ivan Janevski | meta:texrender-examples-2 [August 13, 2026 at 18:09] (current) – removed Ivan Janevski | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | \documentclass[ | + | |
| - | tikz | + | |
| - | ,border = 3.14mm | + | |
| - | ]{standalone} | + | |
| - | \usepackage{tikz-3dplot} | + | |
| - | \usetikzlibrary{ | + | |
| - | arrows.meta | + | |
| - | ,angles | + | |
| - | } | + | |
| - | \pgfmathdeclarefunction{sphereX}{2}{% | + | |
| - | % #1 - longitude | + | |
| - | % #1 - latitude | + | |
| - | \pgfmathparse{cos(# | + | |
| - | } | + | |
| - | \pgfmathdeclarefunction{sphereY}{2}{% | + | |
| - | \pgfmathparse{cos(# | + | |
| - | } | + | |
| - | \pgfmathdeclarefunction{sphereZ}{2}{% | + | |
| - | \pgfmathparse{sin(# | + | |
| - | } | + | |
| - | \pgfmathdeclarefunction{stereographicprojection}{2}{% | + | |
| - | \pgfmathparse{# | + | |
| - | } | + | |
| - | \pgfmathsetmacro{\azimuth}{100} | + | |
| - | \pgfmathsetmacro{\elevation}{30} | + | |
| - | \pgfmathsetmacro{\longitude}{60} | + | |
| - | \pgfmathsetmacro{\latitude}{30} | + | |
| - | \begin{document} | + | |
| - | \pgfmathsetmacro{\scale}{2} | + | |
| - | \tdplotsetmaincoords{90-\elevation}{\azimuth} | + | |
| - | \begin{tikzpicture}[tdplot_main_coords, | + | |
| - | % x, y and z axes (pre-clip) | + | |
| - | \draw[-latex] | + | |
| - | (-2.5*\scale, | + | |
| - | node[pos=1, | + | |
| - | {$\scriptstyle x, | + | |
| - | \draw[-latex] | + | |
| - | (0, | + | |
| - | \draw[-latex] | + | |
| - | (0, | + | |
| - | \begin{scope} | + | |
| - | % clip and blank out sphere | + | |
| - | \clip[ | + | |
| - | tdplot_screen_coords | + | |
| - | ,postaction = { | + | |
| - | %tdplot_screen_coords | + | |
| - | ,fill | + | |
| - | ,white | + | |
| - | } | + | |
| - | ] (0,0) circle [radius = {1*\scale}]; | + | |
| - | % x, y and z axes (post-clip) | + | |
| - | \draw[densely dashed] | + | |
| - | (-2.5*\scale, | + | |
| - | \draw[densely dashed] | + | |
| - | (0, | + | |
| - | \draw[densely dashed] | + | |
| - | (0, | + | |
| - | % outer circle | + | |
| - | \draw[tdplot_screen_coords] | + | |
| - | (0,0) circle [radius = {1*\scale}]; | + | |
| - | \draw[densely dashed] | + | |
| - | (\azimuth: | + | |
| - | start angle = {\azimuth} | + | |
| - | ,end angle = {\azimuth+180} | + | |
| - | ,radius = {1*\scale} | + | |
| - | ]; | + | |
| - | \draw (\azimuth: | + | |
| - | start angle = {\azimuth} | + | |
| - | ,end angle = {\azimuth-180} | + | |
| - | ,radius = {1*\scale} | + | |
| - | ]; | + | |
| - | % origin | + | |
| - | \coordinate (O) at (0,0); | + | |
| - | % point on sphere | + | |
| - | \coordinate (P) at | + | |
| - | ( | + | |
| - | {sphereX(\longitude, | + | |
| - | , | + | |
| - | , | + | |
| - | ); | + | |
| - | % stereographic projection | + | |
| - | % of point on sphere | + | |
| - | \coordinate (P') at | + | |
| - | ( | + | |
| - | { | + | |
| - | stereographicprojection( | + | |
| - | sphereX(\longitude, | + | |
| - | , | + | |
| - | )*\scale | + | |
| - | } | + | |
| - | ,{ | + | |
| - | stereographicprojection( | + | |
| - | sphereY(\longitude, | + | |
| - | , | + | |
| - | )*\scale | + | |
| - | } | + | |
| - | ,{0} | + | |
| - | ); | + | |
| - | % north pole | + | |
| - | \coordinate (N) at (0, | + | |
| - | % south pole | + | |
| - | \coordinate (S) at (0, | + | |
| - | % point opposite from P | + | |
| - | \coordinate (Q) at | + | |
| - | ( | + | |
| - | {-sphereX(\longitude, | + | |
| - | , | + | |
| - | , | + | |
| - | ); | + | |
| - | % stereographic projection of | + | |
| - | % point opposite from P | + | |
| - | \coordinate (Q') at | + | |
| - | ( | + | |
| - | { | + | |
| - | stereographicprojection( | + | |
| - | -sphereX(\longitude, | + | |
| - | , | + | |
| - | )*\scale | + | |
| - | } | + | |
| - | ,{ | + | |
| - | stereographicprojection( | + | |
| - | -sphereY(\longitude, | + | |
| - | , | + | |
| - | )*\scale | + | |
| - | } | + | |
| - | ,{0} | + | |
| - | ); | + | |
| - | % orthogonal projection of | + | |
| - | % P onto the xy plane | + | |
| - | \coordinate (projP) at | + | |
| - | ( | + | |
| - | {sphereX(\longitude, | + | |
| - | , | + | |
| - | ,{0} | + | |
| - | ); | + | |
| - | % constructions which don't exceed the clip | + | |
| - | \draw | + | |
| - | (P) -- (Q) | + | |
| - | (N) -- (0, | + | |
| - | (1*\scale, | + | |
| - | (0, | + | |
| - | (P) -- (projP) | + | |
| - | ; | + | |
| - | \draw[densely dashed] | + | |
| - | (N) -- (Q); | + | |
| - | \end{scope} | + | |
| - | % constructions which exceed the clip | + | |
| - | \draw | + | |
| - | (N) -- (P') | + | |
| - | (Q') -- (P') | + | |
| - | ; | + | |
| - | % points | + | |
| - | \pgfmathsetmacro{\pointradius}{0.025*\scale} | + | |
| - | \begin{scope}[tdplot_screen_coords] | + | |
| - | \fill | + | |
| - | (O) circle[radius = \pointradius] | + | |
| - | node[below left=5pt]{$\scriptstyle O$}; | + | |
| - | \fill | + | |
| - | (P) circle[radius = \pointradius] | + | |
| - | node[above right]{$\scriptstyle P$}; | + | |
| - | \fill | + | |
| - | (P') circle[radius = \pointradius] | + | |
| - | node[right]{$\scriptstyle z$}; | + | |
| - | \fill | + | |
| - | (N) circle[radius = \pointradius] | + | |
| - | node[above left]{$\scriptstyle N$}; | + | |
| - | \fill | + | |
| - | (S) circle[radius = \pointradius] | + | |
| - | node[right]{$\scriptstyle S$}; | + | |
| - | \fill | + | |
| - | (Q) circle[radius = \pointradius] | + | |
| - | node[above left]{$\scriptstyle Q$}; | + | |
| - | \fill | + | |
| - | (Q') circle[radius = \pointradius] | + | |
| - | node[above left]{$\scriptstyle W$}; | + | |
| - | \end{scope} | + | |
| - | % angles | + | |
| - | \draw[-latex] | + | |
| - | (0.25*\scale, | + | |
| - | start angle = {0} | + | |
| - | ,end angle = {\longitude} | + | |
| - | ,radius = {0.25*\scale} | + | |
| - | ] | + | |
| - | node [ | + | |
| - | pos = {0.5} | + | |
| - | ,below | + | |
| - | ] {$\scriptstyle\theta$}; | + | |
| - | \draw[-latex] | + | |
| - | (0.15*\scale, | + | |
| - | start angle = {0} | + | |
| - | ,end angle = {\longitude + 180} | + | |
| - | ,radius = {0.15*\scale} | + | |
| - | ] node [ | + | |
| - | pos = 0.95 | + | |
| - | ,above | + | |
| - | ]{$\scriptstyle\theta_{w}$}; | + | |
| - | \draw[ | + | |
| - | smooth | + | |
| - | ,domain = {90: | + | |
| - | ,variable = {\latitude} | + | |
| - | ,-latex | + | |
| - | ] plot ( | + | |
| - | | + | |
| - | , | + | |
| - | , | + | |
| - | ) node [ | + | |
| - | pos = {0} | + | |
| - | ,above right = {5pt} | + | |
| - | ]{$\scriptstyle\phi$}; | + | |
| - | \draw pic [ | + | |
| - | draw | + | |
| - | ,- | + | |
| - | ,angle eccentricity = {1.4} | + | |
| - | ,angle radius = {0.2cm} | + | |
| - | ]{right angle=O--projP--P}; | + | |
| - | \end{tikzpicture} | + | |
| - | \end{document} | + | |
meta/texrender-examples-2.1786644208.md.gz · Last modified: by Ivan Janevski
