In tkz-euclide
the legth of a segment is determined via:
\tkzCalcLength[<unit>](<point1>,<point2>) \tkzGetLength{<variableName>}
As you can see, you can also specify the unit in which you want the result. And, of course, don't forget the \
before <variableName>
, when using it later in the code. :)
Edit: To avoid errors at compilation, you will need to specify the unit every time you use \<varialbleName>
, e.g.:
\tkzCalcLength(R,Q) \tkzGetLength{dRQ}
\tkzCalcLength[cm](M,Q) \tkzGetLength{dMQ}
\tkzDrawCircle[R](O,\dRQ cm)
\tkzDrawCircle[R](P,\dMQ pt)
Edit2: OK, here is the full working example, in case it doesn't work for somebody:
% Morley's triangle
% Author : Arnaud Lefebvre (IREM Rouen)
% Ported to tkz-euclide : Count Zero
% Intersections of trisector lines in any triangle
% are vertices of an equilateral triangle
\documentclass{article}
\usepackage{tkz-euclide}
\usetikzlibrary{calc,intersections}
\usetkzobj{all}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
%----------------------------------------------------
% Coordinates of A, B and C, the triangle vertices
%----------------------------------------------------
\coordinate[label=above:$A$] (A) at (5,4);
\coordinate[label=left:$B$] (B) at (0,0);
\coordinate[label=right:$C$] (C) at (7,0);
%----------------------------------------------------
% Lengths of segments [AB], [BC], and [CA]
%----------------------------------------------------
\tkzCalcLength(B,C) \tkzGetLength{a}
\pgfmathsetmacro{\la}{.01*\a pt}
\tkzCalcLength(A,C) \tkzGetLength{b}
\pgfmathsetmacro{\lb}{.01*\b pt}
\tkzCalcLength(A,B) \tkzGetLength{c}
\pgfmathsetmacro{\lc}{.01*\c pt}
%----------------------------------------------------
% Computing 1/3 of each angle
%----------------------------------------------------
\pgfmathsetmacro{\A}{acos((\la*\la-\lb*\lb-\lc*\lc)/(-2*\lb*\lc))};
\pgfmathsetmacro{\tA}{\A/3};
\pgfmathsetmacro{\B}{acos((\lb pt*\lb pt-\la pt*\la pt-\lc pt*\lc pt)/(-2*\la pt*\lc pt))};
\pgfmathsetmacro{\tB}{\B/3};
\pgfmathsetmacro{\C}{acos((\lc pt*\lc pt-\lb pt*\lb pt-\la pt*\la pt)/(-2*\lb pt*\la pt))};
\pgfmathsetmacro{\tC}{\C/3};
%----------------------------------------------------
% Computing intersections of trisector lines
%----------------------------------------------------
\coordinate (A1) at ($(A)!100*max(\lb pt,\lc pt)!\tA:(B)$);
\coordinate (A2) at ($(A)!100*max(\lb pt,\lc pt)!2*\tA:(B)$);
\coordinate (B1) at ($(B)!100*max(\la pt,\lc pt)!\tB:(C)$);
\coordinate (B2) at ($(B)!100*max(\la pt,\lc pt)!2*\tB:(C)$);
\coordinate (C1) at ($(C)!100*max(\la pt,\lb pt)!\tC:(A)$);
\coordinate (C2) at ($(C)!100*max(\la pt,\lb pt)!2*\tC:(A)$);
%----------------------------------------------------
% Computing coordinates of vertices O, P and Q of
% the Morley's triangle
%----------------------------------------------------
\coordinate (O) at (intersection of C--C1 and A--A2);
\coordinate (P) at (intersection of A--A1 and B--B2);
\coordinate (Q) at (intersection of B--B1 and C--C2);
%----------------------------------------------------
% Drawing triangles and trisectors
%----------------------------------------------------
\tkzMarkAngle[size=1,fill=green!80](B,A,A1)
\tkzMarkAngle[size=.9,fill=green!80](A1,A,A2)
\tkzMarkAngle[size=.8,fill=green!80](A2,A,C)
\tkzMarkAngle[size=1,fill=blue!80](C,B,B1)
\tkzMarkAngle[size=.9,fill=blue!80](B1,B,B2)
\tkzMarkAngle[mkpos=.2,size=.8,fill=blue!80](B2,B,A)
\tkzMarkAngle[size=1,fill=red!80](A,C,C1)
\tkzMarkAngle[size=.9,fill=red!80](C1,C,C2)
\tkzMarkAngle[size=.8,fill=red!80](C2,C,B)
\draw (A)--(B)--(C)--cycle;
\draw[fill=orange, opacity=.4]
(O)--node[sloped]{\tiny{//}}
(P)--node[sloped]{\tiny{//}}
(Q)--node[sloped]{\tiny{//}}(O);
\draw (A)--(O) (A)--(P) (B)--(P) (B)--(Q) (C)--(Q) (C)--(O);
%----------------------------------------------------
% Caption
%----------------------------------------------------
\node[rounded corners, fill=purple!20,anchor=south east] at (3,3)
{\begin{minipage}{5cm}
\textbf{Morley's triangle}\newline In any triangle, trisector
lines intersect in 3 points that are vertices of an
equilateral triangle.
\end{minipage}};
\end{tikzpicture}
\end{document}
So, no more complaints will be accepted! All right, just kidding... ;)
Are you just trying to label the angle? If so just use label={}
to specify what you want.
\documentclass{article}
\usepackage{tikz}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[>=latex]
\tkzInit
\tkzDefPoint(2,2){A}
\tkzDefPoint(0,0){B}
\tkzDefPoint(5,0){C}
%angulos
\tkzMarkAngle[fill=green!50,size=7mm,label={$35^\circ$}](A,C,B)
\tkzLabelPoints[right](C)
\tkzDrawSegments(B,C C,A)
\draw ($(C)+(165:.5)$) -- ($(C)+(165:.9)$);
%\draw[red,<-] ($(C)+(165:.9)$) to[out=180,in=0] +(-1,.5) node[left] {mark};
\end{tikzpicture}
\end{document}
Best Answer
You could use options when drawing, such as
or set styles, such as by
\tkzSetUpPoint
and\tkzSetUpLine
, which are explained in the tkz-euclide manual.Regarding the labels, you could set their style via an option to the
tikzpicture
or by\tikzset
, such asBy this, the picture changes to