How to draw a lune of Hippocrates?
Using your code, you would theoretically need only two points, A
and B
. The first solution is about your code, the second is to show the Lune of Hippocrates.
OP's code
Code
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\newcommand{\mnskos}[3][blue!10]{%
\tkzDefPoint(#2){A}
\tkzDefPoint(#3){B}
\tkzDefLine[mediator](A,B) \tkzGetPoints{a}{b}
\tkzDefPointWith[linear,K=.3](a,b) \tkzGetPoint{K}
\tkzDefLine[perpendicular=through K, K=.5](A,B)\tkzGetPoint{L}
\begin{scope}
\tkzDrawArc[fill=#1](K,A)(B)
\clip (L) rectangle (A-|B);
\tkzFillCircle[fill=white](L,A)
\end{scope}
\tkzDrawArc(L,A)(B)
\tkzDrawPoints(A,B,K,L)
\tkzLabelPoints(A,B,K,L)
}
\begin{document}
\begin{tikzpicture}
\mnskos{0,1}{1.5,2.5}
\end{tikzpicture}
\end{document}
Lune of Hippocrates
Code
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\newcommand{\mskos}[3][blue!10]{%
\tkzDefPoint(#2){A}
\tkzDefPoint(#3){B}
\tkzDefSquare(A,B) \tkzGetSecondPoint{C}
\tkzDrawAltitude[draw=none](B,C)(A) \tkzGetPoint{O}
\tkzDrawArc[color=black](O,C)(B)
\tkzDefMidPoint(A,B) \tkzGetPoint{D}
%
% this
%\begin{scope}
%\tkzDefSquare(B,A) \tkzGetPoints{c}{d}
%\tkzClipPolygon(A,B,d,c)
%\tkzDrawArc[color=black, #1](D,A)(B)
%\tkzFillCircle[draw=black,fill=white](O,A)
%\end{scope}
%
% or this
\tkzCalcLength[cm](O,A) \tkzGetLength{rAB}
\tkzCalcLength[cm](B,D) \tkzGetLength{rBD}
\filldraw[black, fill=#1] (A)
arc (270:360:\rAB)
node[pos=.5, font=\tiny, below right, inner sep=0, outer sep=0pt] {$e$}
arc (45:-135:\rBD)
node[pos=.5, font=\tiny, below right, inner sep=0, outer sep=0pt] {$f$}
;
%
\tkzDrawSegment[style=dashed](C,O)
\tkzFillPolygon[draw=black,fill=#1](A,B,O)
\tkzDrawPoints[fill=black, size=3pt](A,B,C,D,O)
\tkzLabelPoints[font=\tiny, above](B,C,O)
\tkzLabelPoints[font=\tiny, below](A,D)
}
\begin{document}
\begin{tikzpicture}
\tkzInit[xmin=-2,xmax=2,ymin=0,ymax=3]
\tkzClip
\mskos{0,1}{1.5,2.5}
\end{tikzpicture}
\end{document}
One should always be careful using the intersections
library as it may not be accurate enough, but given two centres and two radii (and assuming the circles intersect), the following seems to work OK:
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{intersections,calc}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (1,2);
\begin{scope}[overlay]
\path [name path=A] (A) circle [radius=3];
\path [name path=B] (B) circle [radius=3/2];
\path [name intersections={of=A and B, by={p1,p2}}];
\end{scope}
\draw [dashed] (p1) -- (A) -- (p2);
\draw [dashed] (p1) -- (B) -- (p2);
\fill [red] let
\p1=(A),\p2=(B),\p3=(p1),\p4=(p2),
\n1={veclen(\x3-\x1,\y3-\y1)},
\n2={atan2(\y3-\y1,\x3-\x1)}, \n3={atan2(\y4-\y1,\x4-\x1)},
\n4={veclen(\x3-\x2,\y3-\y2)},
\n5={atan2(\y3-\y2,\x3-\x2)}, \n6={atan2(\y4-\y2,\x4-\x2)} in
($(A)+(\n2:\n1)$) arc (\n2:\n3:\n1) arc(\n6:\n5:\n4) -- cycle;
\foreach \n in {A, B, p1,p2}
\fill (\n) circle [radius=.05];
\end{tikzpicture}
\end{document}