summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-topaths.arcthrough.tex
blob: 10b125a39bd5204f52d8a045b888cdd819435f18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
% !TeX root = tikz-ext-manual.tex
% !TeX spellcheck = en_US
% Copyright 2022 by Qrrbrbirlbel
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Free Documentation License.
%

\section{Arcs through Three Points}
\label{library:topaths.arcthrough}
\begin{tikzlibrary}{topaths.arcthrough}
  This library allows to use an arc defined by three points.
\end{tikzlibrary}

\begin{codeexample}[width=10cm,preamble=\usetikzlibrary{topaths.arcthrough}]
\begin{tikzpicture}
\coordinate[label=above right:$A$] (A) at ( 3, 1);
\coordinate[label=above:$B$]       (B) at ( 1, 2);
\coordinate[label=below left:$C$]  (C) at (-2,-2);

\draw[ultra thick, draw=green, fill=green!50]
  (B) to[arc through={clockwise,(A)}] (C) 
  -- (arc through center) -- cycle;
\draw[ultra thick, draw=blue, fill=blue!50]
  (B) to[arc through=(A)]             (C)
  -- (arc through center) -- cycle;

\foreach \p in {A,B,C, arc through center} \fill[red] (\p) circle[radius=2pt];
\end{tikzpicture}
\end{codeexample}

This can only by used for circles in the |canvas| coordinate system.

\begin{key}{/tikz/arc through/through=\meta{coordinate} (initially {(0,0)})}
  The coordinate on the circle that defines~-- together with the
  starting and target point~-- a circle.
\end{key}

\begin{key}{/tikz/arc through/center suffix=\meta{suffix} (initially {})}
  The |arc through| will define a coordinate named |arc through center|\meta{suffix}
  so that it can referenced later.
\end{key}

\begin{key}{/tikz/arc through/clockwise}
  The resulting arc will go clockwise from the starting point to the target point.
  This will not necessarily go through the |through| point.
\end{key}

\begin{key}{/tikz/arc through/counter clockwise}
  The resulting arc will go counter clockwise from the starting point to the target point.
  This will not necessarily go through the |through| point.
\end{key}

\begin{key}{/tikz/arc through=\meta{key-value}}
  This key should be used with |to| or |edge|.
  A parameter other than |center suffix|, |clockwise| or |counter clockwise| will
  be assumed to be the |through| coordinate.
\end{key}