4

In this semi-circle, I would like to draw several radii by varying the angle as shown. What changes can I do to my code code?

enter image description here

\documentclass{standalone}
%\documentclass{amsart}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}[baseline=(current bounding box.north)]

\draw [ultra thick, line width=0.70mm, black, fill=white] (-1.0,0) -- (0.0,0) arc(0:180:1.0) --cycle;
%
\draw [ultra thick, line width=0.70mm, black, fill=white] (-1.0,0) -- (0.0,0) arc(0:180:1.0) --cycle;
\draw [ultra thick, line width=0.70mm, black] (-1,0) -- (0,);
\end{tikzpicture}

\end{document}
1
  • 1
    off topic: if you pass line width=0.70mm you don't have to pass ultra thick, which is a predefined thickness. – Sigur Feb 24 '18 at 14:17
7

For whom it may interest, it is not too difficult to do with MetaPost, thanks to a simple loop.

beginfig(1);
    u := 5cm;
    pickup pencircle scaled 8bp;
    for i = 0 upto 6:
        draw origin -- u*dir 30i;
    endfor;
    draw halfcircle scaled 2u;
endfig;
end.

enter image description here

3
7

Use something like

\foreach \x in {15,30,45,60,75,90} {
        \draw [black] (-1,0) -- +(\x:1);
      }

which will use \x as one of the angles 15 to 90, for example and --+(\x:1) will draw them as a radius of the relevant angle with length 1

\documentclass{standalone}
% \documentclass{amsart}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}[baseline=(current bounding box.north)]

  \draw [line width=0.70mm, black, fill=white] (-1.0,0) -- (0.0,0) arc(0:180:1.0) --cycle;
  % 
  \draw [line width=0.70mm, black, fill=white] (-1.0,0) -- (0.0,0) arc(0:180:1.0) --cycle;
 \foreach \x in {15,30,...,165} {
    \draw [line width=0.7mm,black] (-1,0) -- +(\x:1);
  }

\end{tikzpicture}

\end{document}

enter image description here

6

Here is a simplified code. If you wish the same thickness to whole draw, you can pass it to the whole environment as global.

Also, you don't need to fill the region with white color neither to draw with black color (default).

Finally, you just draw the arc and use the cycle to close it. You don't need the other point.

\documentclass[margin=2pt]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[%
  baseline=(current bounding box.north),
  line width=0.7mm
]
\draw (1,0) arc(0:180:1.0) --cycle;
\foreach \a in {30,60,...,150}{
  \draw (0,0)--+(\a:1cm); 
}
\end{tikzpicture}
\end{document}

enter image description here

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.