Table of Contents

Equation of a Sphere


\begin{tikzpicture} % MERC

%% some definitions
\def\R{3} % sphere radius
\def\angEl{25} % elevation angle
\def\angAz{-100} % azimuth angle
\def\angPhiOne{-50} % longitude of point P
\def\angPhiTwo{-35} % longitude of point Q
\def\angBeta{33} % latitude of point P and Q

%% working planes
\pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole
\LongitudePlane[xzplane]{\angEl}{\angAz}
\LongitudePlane[pzplane]{\angEl}{\angPhiOne}
\LongitudePlane[qzplane]{\angEl}{\angPhiTwo}
\LatitudePlane[equator]{\angEl}{0}

%% draw background sphere
\fill[ball color=grey!10] (0,0) circle (\R); % 3D lighting effect

%% characteristic points
\path[pzplane] (\angBeta:\R) coordinate [label={[black]above left:$P$}] (P);
\drawpoint{P}{.5mm}{black};
\coordinate [label={[black]above left:$O$}] (O) at (0,0);
\drawpoint{O}{.5mm}{black};

\path[pzplane] (\R,0) coordinate (PE);
\path[xzplane] (\R,0) coordinate (XE);
\path[pzplane] (\R,0) coordinate [label={[black]above right:$R$}] (R);
\drawpoint{R}{.5mm}{black};
\draw[dotted,black] (O) -- (R);
\drawbrace{O}{R}{2mm}{black}{$r$}{0}{-4mm}{mirror};

%% meridians and latitude circles
\DrawLatitudeCircle[\R]{0} % equator

%% draw lines and put labels
%\draw (-\R,-\H) -- (-\R,2*\R) (\R,-\H) -- (\R,2*\R);
\draw[->] (O) -- (P);

% z axis
\draw[->,dashed,blue] (O) -- +(0,1.5*\R) node[above] {$z$};
% x axis
\path[xzplane] (0:\R) node[below,red] {$x$} coordinate (x);
\draw[->,dashed,red] (O) -- (x);
% y axis
\path[pyplane] (0:\R) node[left,green!50] {$y$} coordinate (y);
\draw[->,dashed,green!50] (O) -- (y);

% projection P
\path[pzplane] (0.8*\R,0) coordinate [label={[black]above right:$Q$}] (Q);
\drawpoint{Q}{.5mm}{black};
\draw[->,dotted] (P) -- (Q);

%angles
\draw[pzplane,->,thin] (0:0.5*\R) to[bend right=15]
    node[midway,right] {$\alpha$} (\angBeta:0.5*\R);
\draw[equator,->,thin] (\angAz:0.5*\R) to[bend right=30]
    node[pos=0.4,below] {$\beta$} (\angPhiOne:0.5*\R);

\end{tikzpicture}

\begin{eqnarray*}
x &=& r * \cos{\alpha} * \cos{\beta} & \\
y &=& r * \cos{\alpha} * \sin{\beta} & \\
z &=& r * \sin{\alpha}
\end{eqnarray*}

Volume of a Sphere


\begin{tikzpicture}
%% some definitions
\def\R{3} % sphere radius
\def\angEl{25} % elevation angle
\def\angAz{-100} % azimuth angle
\def\angPhiOne{-50} % longitude of point P
\def\angPhiTwo{-35} % longitude of point Q
\def\angBeta{33} % latitude of point P and Q

%% working planes
\pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole
\LongitudePlane[xzplane]{\angEl}{\angAz}
\LongitudePlane[pzplane]{\angEl}{\angPhiOne}
\LongitudePlane[qzplane]{\angEl}{\angPhiTwo}
\LatitudePlane[equator]{\angEl}{0}

%% draw background sphere
\fill[ball color=grey!10] (0,0) circle (\R); % 3D lighting effect

% circles
\foreach \t in {-80,-60,...,80} { \DrawLatitudeCircle[\R]{\t} }
%\foreach \t in {-5,-35,...,-175} { \DrawLongitudeCircle[\R]{\t} }

% z axis
\draw[->,dashed,blue] (O) -- +(0,\R) node[above] {$z$} coordinate (z);
% x axis
\path[xzplane] (0:\R) node[below,red] {$x$} coordinate (x);
\draw[->,dashed,red] (O) -- (x);
% y axis
\path[pyplane] (0:\R) node[left,green!50] {$y$} coordinate (y);
\draw[->,dashed,green!50] (O) -- (y);

% Ox
%\drawbrace{O}{x}{2mm}{black}{$r$}{4mm}{0}{};
% Oy
%\drawbrace{O}{y}{2mm}{black}{$r$}{0}{4mm}{};
% Oz
%\drawbrace{O}{z}{2mm}{black}{$r$}{-4mm}{0}{};

% right-angle
%\node[square,minimum size=1mm, dotted] at (0.1,0.1) [draw,fill] (O) [magenta] {};
%\coordinate[label={[magenta]above right:$90^{\circ}$}] (90) at (0.2, 0.2);

\coordinate [label={[black]left:$O$}] (O) at (0,0);
\drawpoint{O}{.5mm}{black};

\path[pzplane] (\angBeta:\R) coordinate [label={[black]right:$P$}] (P);
\drawpoint{P}{.5mm}{black};

\draw[->,black] (O) -- (P);
\drawbrace{O}{P}{2mm}{black}{$r$}{0}{-4mm}{mirror};

\coordinate [label={[black]left:$Q$}] (Q) at (0,0.5*\R);
\drawpoint{Q}{.5mm}{black};

\draw[dotted] (P) -- (Q);

\end{tikzpicture}

\begin{eqnarray*}
V &=& \frac{4}{3}\pi*r^{3}
\end{eqnarray*}

Area of a Sphere


\begin{tikzpicture}
%% some definitions
\def\R{3} % sphere radius
\def\angEl{25} % elevation angle
\def\angAz{-100} % azimuth angle
\def\angPhiOne{-50} % longitude of point P
\def\angPhiTwo{-35} % longitude of point Q
\def\angBeta{33} % latitude of point P and Q

%% working planes
\pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole
\LongitudePlane[xzplane]{\angEl}{\angAz}
\LongitudePlane[pzplane]{\angEl}{\angPhiOne}
\LongitudePlane[qzplane]{\angEl}{\angPhiTwo}
\LatitudePlane[equator]{\angEl}{0}

%% draw background sphere
\fill[ball color=gray!10] (0,0) circle (\R); % 3D lighting effect
\fill[ball color=gray!75] (0,0) circle (0.75*\R); % 3D lighting effect

% circles
%\foreach \t in {-80,-60,...,80} { \DrawLatitudeCircle[\R]{\t} }

% z axis
\draw[->,dashed,blue] (O) -- +(0,\R) node[above] {$z$} coordinate (z);
% x axis
\path[xzplane] (0:\R) node[below,red] {$x$} coordinate (x);
\draw[->,dashed,red] (O) -- (x);
% y axis
\path[pyplane] (0:\R) node[left,green!50] {$y$} coordinate (y);
\draw[->,dashed,green!50] (O) -- (y);

% Ox
%\drawbrace{O}{x}{2mm}{black}{$r$}{4mm}{0}{};
% Oy
%\drawbrace{O}{y}{2mm}{black}{$r$}{0}{4mm}{};
% Oz
%\drawbrace{O}{z}{2mm}{black}{$r$}{-4mm}{0}{};

% right-angle
%\node[square,minimum size=1mm, dotted] at (0.1,0.1) [draw,fill] (O) [magenta] {};
%\coordinate[label={[magenta]above right:$90^{\circ}$}] (90) at (0.2, 0.2);

\coordinate [label={[black]left:$O$}] (O) at (0,0);
\drawpoint{O}{.5mm}{black};

\path[pzplane] (\angBeta:\R) coordinate [label={[black]right:$P$}] (P);
\drawpoint{P}{.5mm}{black};

\draw[->,black] (O) -- (P);
\drawbrace{O}{P}{2mm}{black}{$r$}{0}{-4mm}{mirror};

\coordinate [label={[black]left:$Q$}] (Q) at (0,0.5*\R);
\drawpoint{Q}{.5mm}{black};

\draw[dotted] (P) -- (Q);

\end{tikzpicture}

\begin{eqnarray*}
A &=& 4\pi r^{2}
\end{eqnarray*}