summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex152
1 files changed, 121 insertions, 31 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
index 9c1a821e26c..c8a38014dba 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
@@ -1,8 +1,11 @@
-% Copyright 2003 by Till Tantau <tantau@cs.tu-berlin.de>.
+% Copyright 2006 by Till Tantau
%
-% This program can be redistributed and/or modified under the terms
-% of the LaTeX Project Public License Distributed from CTAN
-% archives in directory macros/latex/base/lppl.txt.
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
\section{Specifying Coordinates}
@@ -18,6 +21,7 @@ never refer to an absolute position on the page, but to a position
inside the current |{pgfpicture}| environment. To specify a coordinate
you can use commands that start with |\pgfpoint|.
+
\subsection{Basic Coordinate Commands}
The following commands are the most basic for specifying a
@@ -42,9 +46,13 @@ coordinate.
Yields the origin. Same as |\pgfpoint{0pt}{0pt}|.
\end{command}
-\begin{command}{\pgfpointpolar\marg{degree}\marg{radius}}
+\begin{command}{\pgfpointpolar\marg{degree}{\ttfamily\char`\{}\meta{radius}\opt{|/|\meta{y-radius}}{\ttfamily\char`\}}}
Yields a point location given in polar coordinates. You can specify
the angle only in degrees, radians are not supported, currently.
+
+ If the optional \meta{y-radius} is given, the polar coordinate is
+ actually a coordinate on an ellipse whose $x$-radius is given by
+ \meta{radius} and whose $y$-radius is given by \meta{y-radius}.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -52,13 +60,22 @@ coordinate.
\foreach \angle in {0,10,...,90}
{\pgfpathcircle{\pgfpointpolar{\angle}{1cm}}{2pt}}
\pgfusepath{fill}
+\end{tikzpicture}
+\end{codeexample}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[help lines] (0,0) grid (3,2);
+
+ \foreach \angle in {0,10,...,90}
+ {\pgfpathcircle{\pgfpointpolar{\angle}{1cm/2cm}}{2pt}}
+ \pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
\end{command}
-\subsection{Coordinates in the Xy- and Xyz-Coordinate Systems}
+\subsection{Coordinates in the XY-Coordinate System}
Coordinates can also be specified as multiples of an $x$-vector and a
$y$-vector. Normally, the $x$-vector points one centimeter in the
@@ -68,10 +85,6 @@ $y$-direction, but using the commands |\pgfsetxvec| and
$y$-vector do not necessarily point ``horizontally'' and
``vertically.''
-It is also possible to specify a point as a multiple of three vectors,
-the $x$-, $y$-, and $z$-vector. This is useful for creating simple
-three dimensional graphics.
-
\begin{command}{\pgfpointxy\marg{$s_x$}\marg{$s_y$}}
Yields a point that is situated at $s_x$ times the
$x$-vector plus $s_y$ times the $y$-vector.
@@ -85,27 +98,6 @@ three dimensional graphics.
\end{codeexample}
\end{command}
-\begin{command}{\pgfpointxyz\marg{$s_x$}\marg{$s_y$}\marg{$s_z$}}
- Yields a point that is situated at $s_x$ times the
- $x$-vector plus $s_y$ times the $y$-vector plus $s_z$ times the
- $z$-vector.
-\begin{codeexample}[]
-\begin{pgfpicture}
- \pgfsetarrowsend{to}
-
- \pgfpathmoveto{\pgfpointorigin}
- \pgfpathlineto{\pgfpointxyz{0}{0}{1}}
- \pgfusepath{stroke}
- \pgfpathmoveto{\pgfpointorigin}
- \pgfpathlineto{\pgfpointxyz{0}{1}{0}}
- \pgfusepath{stroke}
- \pgfpathmoveto{\pgfpointorigin}
- \pgfpathlineto{\pgfpointxyz{1}{0}{0}}
- \pgfusepath{stroke}
-\end{pgfpicture}
-\end{codeexample}
-\end{command}
-
\begin{command}{\pgfsetxvec\marg{point}}
Sets that current $x$-vector for usage in the $xyz$-coordinate
@@ -132,10 +124,108 @@ three dimensional graphics.
Works like |\pgfsetyvec|.
\end{command}
+
+
+\begin{command}{\pgfpointpolarxy\marg{degree}{\ttfamily\char`\{}\meta{radius}\opt{|/|\meta{y-radius}}{\ttfamily\char`\}}}
+ This command is similar to the |\pgfpointpolar| command, but the
+ \meta{radius} is now a factor to be interpreted in the
+ $xy$-coordinate system. This means that a degree of |0| is the same
+ as the $x$-vector of the $xy$-coordinate system times \meta{radius}
+ and a degree of |90| is the $y$-vecotr times \meta{radius}. As for
+ |\pgfpointpolar|, a \meta{radius} can also be a pair separated by a
+ slash. In this case, the $x$- and $y$-vectors are multiplied by
+ different factors.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[help lines] (0,0) grid (3,2);
+
+ \begin{scope}[x={(1cm,-5mm)},y=1.5cm]
+ \foreach \angle in {0,10,...,90}
+ {\pgfpathcircle{\pgfpointpolarxy{\angle}{1}}{2pt}}
+ \pgfusepath{fill}
+ \end{scope}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+
+
+\subsection{Three Dimensional Coordinates}
+
+It is also possible to specify a point as a multiple of three vectors,
+the $x$-, $y$-, and $z$-vector. This is useful for creating simple
+three dimensional graphics.
+
+\begin{command}{\pgfpointxyz\marg{$s_x$}\marg{$s_y$}\marg{$s_z$}}
+ Yields a point that is situated at $s_x$ times the
+ $x$-vector plus $s_y$ times the $y$-vector plus $s_z$ times the
+ $z$-vector.
+\begin{codeexample}[]
+\begin{pgfpicture}
+ \pgfsetarrowsend{to}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpointxyz{0}{0}{1}}
+ \pgfusepath{stroke}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpointxyz{0}{1}{0}}
+ \pgfusepath{stroke}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpointxyz{1}{0}{0}}
+ \pgfusepath{stroke}
+\end{pgfpicture}
+\end{codeexample}
+\end{command}
+
\begin{command}{\pgfsetzvec\marg{point}}
Works like |\pgfsetzvec|.
\end{command}
+Inside the $xyz$-coordinate system, you can also specify points
+using spherical and cylindrical coordinates.
+
+
+\begin{command}{\pgfpointcylindrical\marg{degree}\marg{radius}\marg{height}}
+ This command yields the same as
+\begin{verbatim}
+\pgfpointadd{\pgfpointpolarxy{degree}{radius}}{\pgfpointxyz{0}{0}{height}}
+\end{verbatim}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [->] (0,0) -- (1,0,0) node [right] {$x$};
+ \draw [->] (0,0) -- (0,1,0) node [above] {$y$};
+ \draw [->] (0,0) -- (0,0,1) node [below left] {$z$};
+
+ \pgfpathcircle{\pgfpointcylindrical{80}{1}{.5}}{2pt}
+ \pgfusepath{fill}
+
+ \draw[red] (0,0) -- (0,0,.5) -- +(80:1);
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfpointspherical\marg{longitude}\marg{latitude}\marg{radius}}
+ This command yields a point ``on the surface of the earth''
+ specified by the \meta{longitude} and the \marg{latitude}. The
+ radius of the earth is given by \meta{radius}. The equator lies in
+ the $xy$-plane.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [->] (0,0) -- (1,0,0) node [right] {$x$};
+ \draw [->] (0,0) -- (0,1,0) node [above] {$y$};
+ \draw [->] (0,0) -- (0,0,1) node [below left] {$z$};
+
+ \foreach \angle in {0,10,...,90}
+ {\pgfpathcircle{\pgfpointspherical{\angle}{0}{1}}{2pt}}
+ \pgfusepath{fill}
+
+ \pgfsetcolor{red}
+ \foreach \angle in {0,10,...,90}
+ {\pgfpathcircle{\pgfpointspherical{80}{\angle}{1}}{2pt}}
+ \pgfusepath{fill}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}