tikz.dev / tkz-euclide Manual

tkz-euclide

Points

12 Defining points using a vector

12.1 \tkzDefPointWith

Points that meet certain vector conditions are created with \tkzDefPointWith. The general principle is as follows: two points, i.e. a vector, are passed as arguments. Depending on the option, the new point forms with the first point (with some exceptions) a vector collinear or orthogonal to the first vector. Its length is either proportional to the length of the first vector, or proportional to the unit. Since this point is often only used temporarily, it does not have to be named immediately: the result is in tkzPointResult, and the macro \tkzGetPoint retrieves it under another name.

Some options set the distance between the given point and the point obtained. In the general case, this distance is the distance between the two points given as arguments; with the options of the normed type, it is 1 cm. The option \(K\) then gives multiples of this distance.

  • \tkzDefPointWith(⟨pt1,pt2⟩)

  • This macro defines a point meeting vector conditions.

    argumentsdefinitionexplanation
    (pt1,pt2)point couplethe result is a point in tkzPointResult

    In what follows, it is assumed that the point is recovered by \tkzGetPoint{C}

    optionsexampleexplanation
    orthogonal[orthogonal](A,B)\(AC=AB\) and \(\overrightarrow{AC} \perp \overrightarrow{AB}\)
    orthogonal normed[orthogonal normed](A,B)\(AC=1\) and \(\overrightarrow{AC} \perp \overrightarrow{AB}\)
    linear[linear](A,B)\(\overrightarrow{AC}=K \times \overrightarrow{AB}\)
    linear normed[linear normed](A,B)\(AC=K\) and \(\overrightarrow{AC}=k\times \overrightarrow{AB}\)
    colinear= at #1[colinear= at C](A,B)\(\overrightarrow{CD}= \overrightarrow{AB}\)
    colinear normed= at #1[colinear normed= at C](A,B)\(\overrightarrow{CD}= \overrightarrow{AB}\)
    K[linear](A,B),K=2\(\overrightarrow{AC}=2\times \overrightarrow{AB}\)
12.1.1 Option colinear at, simple example

\((\overrightarrow{AB}=\overrightarrow{CD})\)

Compiled output

\begin{tikzpicture}[scale=1.2,
vect/.style={->,shorten >=1pt,>=latex'}]
\tkzDefPoint(2,3){A} \tkzDefPoint(4,2){B}
\tkzDefPoint(0,1){C}
\tkzDefPointWith[colinear=at C](A,B)
\tkzGetPoint{D}
\tkzDrawPoints[new](A,B,C,D)
\tkzLabelPoints[above right=3pt](A,B,C,D)
\tkzDrawSegments[vect](A,B C,D)
\end{tikzpicture}
12.1.2 Option colinear at, complex example

Compiled output

\begin{tikzpicture}[scale=.75]
\tkzDefPoints{0/0/B,3.6/0/C,1.5/4/A}
\tkzDefSpcTriangle[ortho](A,B,C){Ha,Hb,Hc}
\tkzDefTriangleCenter[ortho](A,B,C) \tkzGetPoint{H}
\tkzDefSquare(A,C) \tkzGetPoints{R}{S}
\tkzDefSquare(B,A) \tkzGetPoints{M}{N}
\tkzDefSquare(C,B) \tkzGetPoints{P}{Q}
\tkzDefPointWith[colinear= at M](A,S) \tkzGetPoint{A'}
\tkzDefPointWith[colinear= at P](B,N) \tkzGetPoint{B'}
\tkzDefPointWith[colinear= at Q](C,R) \tkzGetPoint{C'}
\tkzDefPointBy[projection=onto P--Q](Ha) \tkzGetPoint{Pa}
\tkzDrawPolygon[teal,thick](A,C,R,S)\tkzDrawPolygon[teal,thick](A,B,N,M)
\tkzDrawPolygon[teal,thick](C,B,P,Q)
\tkzDrawPoints[teal,size=2](A,B,C,Ha,Hb,Hc,A',B',C')
\tkzDrawSegments[ultra thin,red](M,A' A',S P,B' B',N Q,C' C',R B,S C,M C,N B,R A,P A,Q)
\tkzDrawSegments[ultra thin,teal, dashed](A,Ha B,Hb C,Hc)
\tkzDefPointBy[rotation=center A angle 90](S) \tkzGetPoint{S'}
\tkzDrawSegments[ultra thin,teal,dashed](B,S' A,S' A,A' M,S' B',Q P,C' M,S Ha,Pa)
\tkzDrawArc(A,S)(S')
\end{tikzpicture}
12.1.3 Option colinear at: how to use \(K\)

How to use \(K\)

Compiled output

\begin{tikzpicture}[vect/.style={->,
shorten >=1pt,>=latex'}]
\tkzDefPoints{0/0/A,5/0/B,1/2/C}
\tkzDefPointWith[colinear=at C](A,B)
\tkzGetPoint{G}
\tkzDefPointWith[colinear=at C, K=0.5](A,B)
\tkzGetPoint{H}
\tkzLabelPoints(A,B,C,G,H)
\tkzDrawPoints(A,B,C,G,H)
\tkzDrawSegments[vect](A,B C,H)
\end{tikzpicture}
12.1.4 Option colinear at with \(K=\sqrt{2}/2\)

With \(K=\frac{\sqrt{2}}{2}\)

Compiled output

\begin{tikzpicture}[vect/.style={->,
shorten >=1pt,>=latex'}]
\tkzDefPoints{1/1/A,4/2/B,2/2/C}
\tkzDefPointWith[colinear=at C,K=sqrt(2)/2](A,B)
\tkzGetPoint{D}
\tkzDrawPoints[color=red](A,B,C,D)
\tkzDrawSegments[vect](A,B C,D)
\end{tikzpicture}
12.1.5 Option orthogonal with \(K=1\)

AB=AC since \(K=1\).

Compiled output

\begin{tikzpicture}[scale=1.2,
vect/.style={->,shorten >=1pt,>=latex'}]
\tkzDefPoints{2/3/A,4/2/B}
\tkzDefPointWith[orthogonal,K=1](A,B)
\tkzGetPoint{C}
\tkzDrawPoints[color=red](A,B,C)
\tkzLabelPoints[right=3pt](B,C)
\tkzLabelPoints[below=3pt](A)
\tkzDrawSegments[vect](A,B A,C)
\tkzMarkRightAngle(B,A,C)
\end{tikzpicture}
12.1.6 Option orthogonal with \(K=-1\)

With \(K=-1\) OK=OI since \(\lvert K \rvert=1\) then OI=OJ=OK.

Compiled output

\begin{tikzpicture}[scale=.75]
\tkzDefPoints{1/2/O,2/5/I}
\tkzDefPointWith[orthogonal](O,I)
\tkzGetPoint{J}
\tkzDefPointWith[orthogonal,K=-1](O,I)
\tkzGetPoint{K}
\tkzDrawSegment(O,I)
\tkzDrawSegments[->](O,J O,K)
\tkzMarkRightAngles(I,O,J I,O,K)
\tkzDrawPoints(O,I,J,K)
\tkzLabelPoints(O,I,J,K)
\end{tikzpicture}
12.1.7 Option orthogonal: a more complex example

Compiled output

\begin{tikzpicture}[scale=.75]
\tkzDefPoints{0/0/A,6/0/B}
\tkzDefMidPoint(A,B)
\tkzGetPoint{I}
\tkzDefPointWith[orthogonal,K=-.75](B,A)
\tkzGetPoint{C}
\tkzInterLC(B,C)(B,I)
\tkzGetPoints{D}{F}
\tkzDuplicateSegment(B,F)(A,F)
\tkzGetPoint{E}
\tkzDrawArc[delta=10](F,E)(B)
\tkzInterLC(A,B)(A,E)
\tkzGetPoints{N}{M}
\tkzDrawArc[delta=10](A,M)(E)
\tkzDrawLines(A,B B,C A,F)
\tkzCompass(B,F)
\tkzDrawPoints(A,B,C,F,M,E)
\tkzLabelPoints(A,B,C,F,M)
\tkzLabelPoints[above](E)
\end{tikzpicture}
12.1.8 Options colinear and orthogonal

Compiled output

\begin{tikzpicture}[scale=1.2,
vect/.style={->,shorten >=1pt,>=latex'}]
\tkzDefPoints{2/1/A,6/2/B}
\tkzDefPointWith[orthogonal,K=.5](A,B)
\tkzGetPoint{C}
\tkzDefPointWith[colinear=at C,K=.5](A,B)
\tkzGetPoint{D}
\tkzMarkRightAngle[fill=gray!20](B,A,C)
\tkzDrawSegments[vect](A,B A,C C,D)
\tkzDrawPoints(A,...,D)
\end{tikzpicture}
12.1.9 Option orthogonal normed

\(K=1\) \(AC=1\).

Compiled output

\begin{tikzpicture}[scale=1.2,
vect/.style={->,shorten >=1pt,>=latex'}]
\tkzDefPoints{2/3/A,4/2/B}
\tkzDefPointWith[orthogonal normed](A,B)
\tkzGetPoint{C}
\tkzDrawPoints[color=red](A,B,C)
\tkzDrawSegments[vect](A,B A,C)
\tkzMarkRightAngle[fill=gray!20](B,A,C)
\end{tikzpicture}
12.1.10 Option orthogonal normed and K=2

\(K=2\) therefore \(AC=2\).

Compiled output

\begin{tikzpicture}[scale=1.2,
vect/.style={->,shorten >=1pt,>=latex'}]
\tkzDefPoints{2/3/A,5/1/B}
\tkzDefPointWith[orthogonal normed,K=2](A,B)
\tkzGetPoint{C}
\tkzDrawPoints[color=red](A,B,C)
\tkzDefCircle[R](A,2) \tkzGetPoint{a}
\tkzDrawCircle(A,a)
\tkzDrawSegments[vect](A,B A,C)
\tkzMarkRightAngle[fill=gray!20](B,A,C)
\tkzLabelPoints[above=3pt](A,B,C)
\end{tikzpicture}
12.1.11 Option linear

Here \(K=0.5\).

This amounts to applying a homothety or a multiplication of a vector by a real. Here is the midpoint of \([AB]\).

Compiled output

\begin{tikzpicture}[scale=1.2]
\tkzDefPoints{1/3/A,4/2/B}
\tkzDefPointWith[linear,K=0.5](A,B)
\tkzGetPoint{C}
\tkzDrawPoints[color=red](A,B,C)
\tkzDrawSegment(A,B)
\tkzLabelPoints[above right=3pt](A,B,C)
\end{tikzpicture}
12.1.12 Option linear normed

In the following example \(AC=1\) and \(C\) belongs to \((AB)\).

Compiled output

\begin{tikzpicture}[scale=1.2]
\tkzDefPoints{1/3/A,4/2/B}
\tkzDefPointWith[linear normed](A,B)
\tkzGetPoint{C}
\tkzDrawPoints[color=red](A,B,C)
\tkzDrawSegment(A,B)
\tkzLabelSegment(A,C){$1$}
\tkzLabelPoints[above right=3pt](A,B,C)
\end{tikzpicture}
12.2 \tkzGetVectxy

Retrieving the coordinates of a vector.

  • \tkzGetVectxy(⟨\(A,B\)⟩)⟨text⟩

  • Gives the coordinates of a vector.

    argumentsexampleexplanation
    (point){name of macro}\tkzGetVectxy(A,B){V}\Vx,\Vy: coordinates of \(\overrightarrow{AB}\)
12.2.1 Coordinate transfer with \tkzGetVectxy

Compiled output

\begin{tikzpicture}
\tkzDefPoints{0/0/O,1/1/A,4/2/B}
\tkzGetVectxy(A,B){v}
\tkzDefPoint(\vx,\vy){V}
\tkzDrawSegment[->,color=red](O,V)
\tkzDrawSegment[->,color=blue](A,B)
\tkzDrawPoints(A,B,O)
\tkzLabelPoints(A,B,O,V)
\end{tikzpicture}