finding coordinates to the end point of an arc

You can construct the coordinate C first and then \filldraw the whole figure in one sweep.

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \path
     (9.7,-3) coordinate(D)
     arc [radius=4.7, start angle=360, end angle=315] coordinate(C);
  \filldraw[fill=red, draw=red]
     (C)
     arc [radius=4.7, start angle=315, end angle=360]
     -- (0.3,-3) coordinate(A)
     arc [radius=4.7, start angle=180, end angle=225] coordinate(B);
\end{tikzpicture}
\end{document}

Or you can compute the coordinates of (C).

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \newcommand\R{4.7}% radius
  \newcommand\A{45}% angle
  \filldraw[fill=red, draw=red]
     (0.3,-3) coordinate (A)
     arc [radius=\R, start angle=180, end angle={180+\A}] coordinate (B)
     -- ({5+\R*cos(\A)},{-3-\R*sin(\A)}) coordinate (C)
     arc [radius=\R, start angle={360-\A}, end angle=360] coordinate (D);
\end{tikzpicture}
\end{document}

Or you can let tikz compute the coordinates.

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
  \newcommand\R{4.7}% radius
  \newcommand\A{45}% angle
  \coordinate (M) at (5,-3);
  \coordinate (A) at ($(M)+(180:\R)$);
  \coordinate (B) at ($(M)+({180+\A}:\R)$);
  \coordinate (C) at ($(M)+({360-\A}:\R)$);
  \coordinate (D) at ($(M)+(360:\R)$);
  \filldraw[fill=red, draw=red]
     (A) arc [radius=\R, start angle=180, end angle={180+\A}]
     -- (C) arc [radius=\R, start angle={360-\A}, end angle=360];
\end{tikzpicture}
\end{document}

enter image description here


My trigonometry knowledge doesn't allow me to compute the height of the figure, but if you know how to do it, you can use it to clip a circle:

\documentclass[11pt]{article}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}

\begin{scope}
    \clip (0.3,-3) rectangle (9.7,-6.34); 
    \fill[red] (5,-3) circle(4.7);
\end{scope}
\end{tikzpicture}
\end{document}

Update 1:

gernot refreshed my trigonometry and provided the solution:

\documentclass[11pt]{article}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}

\begin{scope}
    %radius*sin(225-180) = 4.7/sqrt(2) = 3,3234018
    \clip (0.3,-3) rectangle (9.7,-6.323); 
    \fill[red] (5,-3) circle(4.7);
\end{scope}
\end{tikzpicture}
\end{document}

Update 2:

And StefanH lets to TikZ calc library to compute the height for us:

\documentclass[11pt]{article}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}  %<---- Load calc library

\begin{document}
\begin{tikzpicture}

\begin{scope}
    \clip (0.3,-3) rectangle ({(9.7,-3)} |- {$(5,-3)+(315:4.7)$}); 
    \fill[red] (5,-3) circle(4.7);
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

Tags:

Tikz Pgf