summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex104
1 files changed, 89 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
index 1847b27bc92..d23d81efb3e 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
@@ -18,7 +18,7 @@ coordinates. Coordinates are always put in round brackets. The general
syntax is
\declare{|(|\opt{|[|\meta{options}|]|}\meta{coordinate specification}|)|}.
-The \meta{coordinate specification} specified coordinates using one of
+The \meta{coordinate specification} specifies coordinates using one of
many different possible \emph{coordinate systems}. Examples are the
Cartesian coordinate system or polar coordinates or spherical
coordinates. No matter which coordinate system is used, in the end, a
@@ -185,7 +185,7 @@ by interpreting them as |pt|. So, |2+3cm| is the same dimension as
polar coordinates. You provide an angle using the |angle=| option
and a radius using the |radius=| option. This yields the point on
the canvas that is at the given radius distance from the origin at
- the given degree. A degree of zero points to the right, a degree of
+ the given degree. An angle of zero degrees to the right, a degree of
90 upward.
\begin{key}{/tikz/cs/angle=\meta{degrees}}
The angle of the coordinate.
@@ -238,7 +238,7 @@ by interpreting them as |pt|. So, |2+3cm| is the same dimension as
point that lies at a given angle on this ellipse, where an angle of
zero is the same as the $x$-vector and an angle of 90 is the
$y$-vector. Finally, multiply the resulting vector by the given
- radius factor. Voilà.
+ radius factor. Voil\`a.
\begin{key}{/tikz/cs/angle=\meta{degrees}}
The angle of the coordinate
interpreted in the ellipse whose axes are the $x$-vector and the
@@ -359,8 +359,8 @@ you use the following coordinate system:
You can use three options to specify which coordinate you mean:
\begin{key}{/tikz/cs/name=\meta{node name}}
- Specifies the node in which you which to specify a coordinate. The
- \meta{node name} is
+ Specifies the node that you wish to use to specify a coordinate.
+ The \meta{node name} is
the name that was previously used to name the node using the
|name=|\meta{node name} option or the special node name syntax.
\end{key}
@@ -375,7 +375,8 @@ you use the following coordinate system:
\draw (node cs:name=circle,anchor=north) |- (0,1);
\draw (node cs:name=ellipse,anchor=north) |- (0,1);
- \draw[-open triangle 90] (node cs:name=rect,anchor=north)
+ \draw [arrows = -{Triangle[open, angle=60:3mm]}]
+ (node cs:name=rect,anchor=north)
|- (0,1) -| (node cs:name=shape,anchor=south);
\end{tikzpicture}
\end{codeexample}
@@ -700,7 +701,7 @@ coordinate system.
\declare{|(|\meta{q}\verb! -| !\meta{p}|)|}.
For example, \verb!(2,1 |- 3,4)! and \verb!(3,4 -| 2,1)! both yield
- the same as \verb!(2,4)! (provided the $xy$-coordinate system has not
+ the same as \verb!(2,4)! (provided the $xy$-co\-or\-di\-nate system has not
been modified).
The most useful application of the syntax is to draw a line up to some
@@ -719,6 +720,30 @@ coordinate system.
\draw[->] (p2) -- (p2 -| yline);
\end{tikzpicture}
\end{codeexample}
+
+ Note that in \declare{|(|\meta{c}\verb! |- !\meta{d}|)|} the
+ coordinates \meta{c} and \meta{d} are \emph{not} surrounded by
+ parentheses. If they need to be complicated expressions (like a
+ computation using the |$|-syntax), %$
+ you must surround them with braces; parentheses will then be added
+ around them.
+
+ As an example, let us specify a point that lies horizontally at the
+ middle of the line from $A$ to~$B$ and vertically at the middle of
+ the line from $C$ to~$D$:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node (A) at (0,1) {A};
+ \node (B) at (1,1.5) {B};
+ \node (C) at (2,0) {C};
+ \node (D) at (2.5,-2) {D};
+
+ \draw (A) -- (B) node [midway] {x};
+ \draw (C) -- (D) node [midway] {x};
+
+ \node at ({$(A)!.5!(B)$} -| {$(C)!.5!(D)$}) {X};
+\end{tikzpicture}
+\end{codeexample}
\end{coordinatesystem}
@@ -728,7 +753,7 @@ coordinate system.
This library enables the calculation of intersections of
two arbitrary paths. However, due to the low accuracy of
\TeX, the paths should not be ``too complicated''.
- In particular, you should not try to intersect paths consisting
+ In particular, you should not try to intersect paths consisting of
lots of very small segments such as plots or decorated paths.
\end{tikzlibrary}
@@ -787,7 +812,7 @@ The following keys can be used in \meta{options}:
\end{key}
\begin{key}{/tikz/intersection/total=\meta{macro}}
- This key will mean than the total number of intersections found
+ This key means that the total number of intersections found
will be stored in \meta{macro}.
\end{key}
@@ -908,14 +933,14 @@ notation to specify numerous points, all relative to the same
There is a special situation, where relative coordinates are
interpreted differently. If you use a relative coordinate as a control
-point of a Bézier curve, the following rule applies: First, a relative
+point of a B\'ezier curve, the following rule applies: First, a relative
first control point is taken relative to the beginning of the
curve. Second, a relative second control point is taken relative to
the end of the curve. Third, a relative end point of a curve is taken
relative to the start of the curve.
This special behavior makes it easy to specify that a curve should
-``leave or arrives from a certain direction'' at the start or end. In
+``leave or arrive from a certain direction'' at the start or end. In
the following example, the curve ``leaves'' at $30^\circ$ and
``arrives'' at $60^\circ$:
@@ -928,6 +953,55 @@ the following example, the curve ``leaves'' at $30^\circ$ and
\end{codeexample}
+\subsubsection{Rotational Relative Coordinates}
+
+You may sometimes wish to specify points relative not only to the
+previous point, but additionally relative to the tangent entering the
+previous point. For this, the following key is useful:
+
+\begin{key}{/tikz/turn}
+ This key can be given as an option to a \meta{coordinate} as in the
+ following example:
+\begin{codeexample}[]
+\tikz \draw (0,0) -- (1,1) -- ([turn]-45:1cm) -- ([turn]-30:1cm);
+\end{codeexample}
+ The effect of this key is to locally shift the coordinate system so
+ that the last point reached is at the origin and the coordinate
+ system is ``turned'' so that the $x$-axis points in the direction of
+ a tangent entering the last point. This means, in effect, that when
+ you use polar coordinates of the form \meta{relative
+ angle}|:|\meta{distance} together with the |turn| option, you
+ specify a point that lies at \meta{distance} from the last point in
+ the direction of the last tangent entering the last point, but with
+ a rotation of \meta{relative angle}.
+
+ This key also works with curves \dots
+\begin{codeexample}[]
+\tikz [delta angle=30, radius=1cm]
+ \draw (0,0) arc [start angle=0] -- ([turn]0:1cm)
+ arc [start angle=30] -- ([turn]0:1cm)
+ arc [start angle=60] -- ([turn]30:1cm);
+\end{codeexample}
+\begin{codeexample}[]
+\tikz \draw (0,0) to [bend left] (2,1) -- ([turn]0:1cm);
+\end{codeexample}
+
+ \dots and with plots \dots
+\begin{codeexample}[]
+\tikz \draw plot coordinates {(0,0) (1,1) (2,0) (3,0) } -- ([turn]30:1cm);
+\end{codeexample}
+
+ Although the above examples use polar coordinates with |turn|, you
+ can also use any normal coordinate. For instance, |([turn]1,1)| will
+ append a line of length $\sqrt 2$ that is turns by $45^\circ$
+ relative to the tangent to the last point.
+\begin{codeexample}[]
+\tikz \draw (0.5,0.5) -| (2,1) -- ([turn]1,1)
+ .. controls ([turn]0:1cm) .. ([turn]-90:1cm);
+\end{codeexample}
+\end{key}
+
+
\subsubsection{Relative Coordinates and Scopes}
\label{section-scopes-relative}
An interesting question is, how do relative coordinates behave in the
@@ -984,7 +1058,7 @@ decide which you need.
It is possible to do some basic calculations that involve
coordinates. In essence, you can add and subtract coordinates, scale
them, compute midpoints, and do projections. For instance,
-|($(a) + 1/3*(1cm,0)$)| is the coordinate that is $1/3$cm to the right
+|($(a) + 1/3*(1cm,0)$)| is the coordinate that is $1/3 \text{cm}$ to the right
of the point |a|:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -1050,7 +1124,7 @@ following rule is used: Once it has been determined, that a
everything up to the next occurrence of |*(|. Note that there is no
space between the asterisk and the parenthesis.
-It is permissible to put the \meta{factor} is curly braces. This can
+It is permissible to put the \meta{factor} in curly braces. This can
be used whenever it is unclear where the \meta{factor} would end.
Here are some examples of coordinate specifications that consist of
@@ -1089,7 +1163,7 @@ $(1-\meta{number})\meta{coordinate x} + \meta{number} \meta{coordinate
\meta{number} is interpreted in the |xcolor| package: First, you use a
factor between $0$ and $1$, not a percentage, and, second, as the
\meta{number} approaches $1$, we approach the second coordinate, not
-the first. It is permissible to use \meta{numbers} that are smaller
+the first. It is permissible to use a \meta{number} that is smaller
than $0$ or larger than $1$. The \meta{number} is evaluated using the
|\pgfmathparse| command and, thus, it can involve complicated
computations.
@@ -1223,7 +1297,7 @@ Here is an example:
\end{codeexample}
The effect is the following: We project the \meta{projection
- coordinate} orthogonally onto to the line from \meta{coordinate} to
+ coordinate} orthogonally onto the line from \meta{coordinate} to
\meta{second coordinate}. This makes it easy to compute projected
points:
\begin{codeexample}[]