0

enter image description here

I am trying to learn how to use tkz-euclide I was wondering if anybody could help be changing this Tikz doc into a tkz-euclide so I can begin to learn how to use it properly.

\documentclass{standalone}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\draw(-5,0) -- (5,0);
\draw[<->](-3,0) node[above] {P} -- (3,0) node[above] {Q};
%from P
\draw[->](-3,0) -- (-3,3);
\draw[->](-3,0) -- (-4,3);
\draw[->](-3,0) -- (-1,2);
\draw[->](-3,0) -- (-2,-3);
\draw[->](-3,0) -- (-4,-2);
\draw[->](-3,0) -- (-1,-4);
\draw[->](-3,0) -- (0,-1);
\draw[->](-3,0) -- (-3,3);
%from Q
\draw[->](3,0) -- (3,3);
\draw[->](3,0) -- (4,3);
\draw[->](3,0) -- (1,2);
\draw[->](3,0) -- (2,-3);
\draw[->](3,0) -- (4,-2);
\draw[->](3,0) -- (1,-4);
\draw[->](3,0) -- (1,-1);
\draw[->](3,0) -- (1,3);




\end{tikzpicture}

\end{document}
2
  • What do you think will help with tkz-euclide? Your question doesn't show much info on why you want to use tkz-euclide and why do you think it can help you with. Since almost all of your lines are very similar (just mirrored), I'd start by naming coordinates and using a loop, for example: \coordinate[label=below left:$P$] (P) at (-3,0) coordinate[label=below right:$Q$](Q) at (3,0); \path[->] foreach \p/\dir in {P/+, Q/-} {(\p) edge +(\dir 0, 3) edge +(\dir -1, 3) edge +(\dir 2, 2) edge +(\dir -1,-2) edge +(\dir 1,-3) edge +(\dir 2,-4)} (P) edge +(3,-1) (Q) edge +(-2,-1) edge +(-2, 3); Commented Oct 2, 2022 at 16:37
  • I just labeled the lines at random for an example. The Idea was to see how to use tkz-uclide so I can use it for more complex diagrams I just wanted a start as I don't quite get the manual.
    – Paul A
    Commented Oct 2, 2022 at 17:39

1 Answer 1

1

It is possible but I think it is a bad idea. Now tkz-euclide is a package dedicated to Euclidean geometry which does not correspond to the proposed figure.

First of all tkz-euclide uses TikZ so you should know a little about the styles of this one. Then, the requested figure uses more tkz-base commands than tkz-euclide commands.

\documentclass{standalone}

\usepackage{tkz-base,tkz-euclide} % loads TikZ

\begin{document}

\begin{tikzpicture}
  \tkzInit[xmin=-5,xmax=5] % from tkz-base
  \tkzDefPoints{-3/0/P,3/0/Q}
  \tkzDrawX[label={},noticks,-] % from tkz-base
  \tkzDrawSegment[<->](P,Q)
%from P \foreach is a command from Tikz
\foreach \i/\j in {-3/3,-4/3,-1/2,-2/-3,-4/-2,-1/-4,0/-1,-3/3}
{\tkzDefPoint(\i,\j){T}
\tkzDrawSegment[->](P,T)
}
%from Q
\foreach \i/\j in {3/3,4/3,1/2,2/-3,4/-2,1/-4,1/-1,1/3}
{\tkzDefPoint(\i,\j){T}
\tkzDrawSegment[->](Q,T)
}
\tkzLabelPoints[below right](P,Q)
\end{tikzpicture}

\end{document}

enter image description here

1
  • Thanks it was to show postulate 1 before I attempt to create a diagram to make this into the axiom eg construction of an equilateral triangle using tkz-uclide.
    – Paul A
    Commented Oct 3, 2022 at 6:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .