1

So I was reading through the tkz-euclide documentation and I saw two different commands being used in a similar manner on examples 4.2.2 and 4.2.3.

  • \tkzDefShiftPoint
  • \tkzDefShiftPointCoord

Both commands seem to take the same types of arguments and their difference(s) don't seem to be explained in the doc.

I copied the code for the second and I switched the commands around, looking for any output differences.

% Original code from doc.
\begin{tikzpicture}[scale=1]
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(30:3){B}
    \tkzDefShiftPointCoord[B](10:2){C}
    \tkzDefShiftPointCoord[A](10:2){D}
    \tkzDrawPolygon(A,...,D)
    \tkzDrawPoints(A,...,D)
\end{tikzpicture}

% Edited code with \tkzDefShiftPoint used instead.
\begin{tikzpicture}[scale=1]
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(30:3){B}
    \tkzDefShiftPoint[B](10:2){C}
    \tkzDefShiftPoint[A](10:2){D}
    \tkzDrawPolygon(A,...,D)
    \tkzDrawPoints(A,...,D)
\end{tikzpicture}

But the output for both tikzpictures are pretty much the same.

May I know what the differences between both commands are?

3
  • They are not called \tkzShiftPoint and \tkzShiftPointCoord but \tkzDefShiftPoint and \tkzDefShiftPointCoord. – AndréC Jul 25 '20 at 8:26
  • Oh yeah, that's a terrible typo. I should fix that. Thanks @AndréC – Kookie Jul 25 '20 at 8:50
  • Their definitions are a little bit different (see the file tkz-pbj-points.tex, lines 215-230: github.com/tkz-sty/tkz-base/blob/master/latex/…). I don't know what kind of differences there are in practical use though. – Torbjørn T. Jul 25 '20 at 18:50
2

There's a small difference. With tkzDefShiftPointCoord you can use coordinates it's impossible with tkzDefShiftPoint.

\documentclass{standalone}
\usepackage{tkz-euclide}

\begin{document}
\begin{tikzpicture}[rotate=15]
\tkzDefPoint(2,3){A}
\tkzDefShiftPointCoord[2,3](15:5){B}
\tkzDefShiftPointCoord[2,3](-15:5){C}
\tkzDrawSegments(A,B B,C C,A)
\tkzDrawPoints(A,B,C)
\tkzLabelPoints(B,C)
\tkzLabelPoint[left](A){$A$}
\end{tikzpicture}

\end{document}
2
  • That is a very subtle difference that I think would be very hard for new users like me to spot. How interesting! – Kookie Aug 16 '20 at 13:34
  • @Kookie \tkzDefShiftPoint is enough and I think it's better to avoid the coordinates. – Alain Matthes Aug 16 '20 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.