3

I am new to LaTeX. I need to draw the following in TikZ or PSTricks. But TikZ is preferable.

enter image description here

Display Name
  • 46,933
  • 5
    What did you try or did find? – Sigur Dec 30 '17 at 15:34
  • How is it possible to vote 8 times for an answer and not vote for the question? As @egreg says, if the question deserves an answer, doesn't it deserve a vote?https://tex.meta.stackexchange.com/questions/6636/why-do-top-users-on-this-site-have-such-high-reputations/6692#6692 – AndréC Jan 01 '18 at 11:55
  • @AndréC: An upvote indicates research effort and usefulness to other users. This question is more of a "please do this for me" request. OP should make an attempt with a Minimal Working Example or at least cite other questions that have parts of the diagram that are similar. Google "tikz angle" and many examples come up. – Sandy G Jan 02 '18 at 04:45
  • @SandyG This shows that the points system is not fully developed and needs to be improved. If each answer automatically assigned a vote to the question, those who answer questions that they feel are not worth a vote would abstain from answering. – AndréC Jan 02 '18 at 07:54

4 Answers4

9

A pstricks solution, based od the pst-eucl module:

 \documentclass{article}

\usepackage{pst-eucl}
% \usepackage{auto-pst-pdf} for use with pdflatex --enablewrite18 (MiKTeX)
% or pdflatex --shell-escape (TeX Live, MacTeX)

\pagestyle{empty}

\begin{document}

\psset{unit=3, dotsize = 3pt, shortput = nab}
\begin{pspicture}(-1,-0.5)(1,1.5)
\pstGeonode[PosAngle = {-90,30,90,150}, PointName = {A, \rlap{$B_1\;(x_{b_1}{,}y_{b_1})$}, B, \llap{$(x_{b_2}{,}y_{b_2})\; B_2$}}, PointNameSep = 0.8em]
(0,0){A}(1; 65){B1}(1; 90){B}(1; 115){B2}
\uput{1.5em}[d](A){$ (x_ a ,y_a) $}
\uput{1.5em}[u](B){$ (x_ b ,y_b) $}
\pstArcOAB{A}{B1}{B2}
\ncline{A}{B}
\psline[linestyle = dashed, linewidth = 0.5pt](B1)(A)(B2)
\ncline[arrows = |<->|, offset = 10pt]{A}{B2}^{$ R $}
\psarc[linewidth = 0.5pt](A){0.25}{65}{90}\uput{0.3}[75](A){$\theta$}
\end{pspicture}

\end{document} 

enter image description here

Bernard
  • 271,350
7

While waiting for a tikz solution after more details from the OP's previous attempts are given, the try below shows it can be a job for MetaPost as well. Code included in a LuaLaTeX program.

Update To prevent the Metafun bug discovered by Ulrike Fischer in the most recent TeX distributions, bug which produces empty arrow heads instead of the expected filled ones (see also the comments here below), I've loaded the mparrows package and set its setarrows parameter to default. This prevents the problem to appear.

\documentclass[border=3mm]{standalone}
\usepackage{luatex85, luamplib}
    \mplibsetformat{metafun}
\begin{document}
\begin{mplibcode}
u = 1.25cm; R = 3u; t = 25; 
input mparrows; setarrows(default);
beginfig(1);
    pair A, B, B[];
    A = origin; B = R*dir 90; B1 = B rotated -t; B2 = B rotated t; 
    draw B1 .. B .. B2; 
    draw A -- B; for P = B1, B2: draw A--P dashed evenly; endfor;
    for P = A, B, B1, B2: drawdot P withpen pencircle scaled 3bp; endfor;
    draw anglebetween(A--B1, A--B, btex $\theta$ etex);
    label.bot(btex $\begin{array}{c} A\\ (x_a, y_a) \end{array}$ etex, A);
    label.top(btex $\begin{array}{c} (x_b, y_b)\\ B \end{array}$ etex, B);
    path radius; radius = (A -- B2) shifted (.18u * unitvector B2 rotated 90);
    drawdblarrow radius; label.lft(btex $R$ etex, point .5 of radius);
    freelabeloffset := 5bp;
    freelabel(btex $B_1(x_{b_1}, y_{b_1})$ etex, B1, A);
    freelabel(btex $(x_{b_2}, y_{b_2})B_2$ etex, B2, A);
endfig;
\end{mplibcode}
\end{document}

enter image description here

Franck Pastor
  • 18,756
6

With TikZ. UPDATE: Shifted the double arrow by (-0.5 \cos\theta,-0.5 \sin\theta), thanks to Sigur.

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[dashed] (0,0) -- (110:5);
\draw[dashed] (0,0) -- (70:5);
\draw (0,5) arc (90:110:5) node [left,yshift=1.5mm] {$(x_{b2},y_{b2})~B_2$};
\draw (0,5) arc (90:70:5) node [right] {$B_1~(x_{b1},y_{b1})$};
\draw[-] node [below] {$\begin{array}{c}A\\ (x_a,y_a)\end{array}$} (0,0) -- (0,5) node [above] {$\begin{array}{c} (x_b,y_b)\\ B\end{array}$};
\draw (0,0) -- (0,1.5) arc (90:70:1.5) node[above,midway] {$\theta$};
\draw[latex-latex,transform canvas={xshift=-0.2165cm,yshift=-0.125em},thick] (0,0) -- (110:5)
node[left,midway] {$R$};
\end{tikzpicture}
\end{document}

enter image description here

  • Nice. But it would be better if the R arrow has length smaller, showing the radius. It is a little bit longer (maybe pointing to B_2 label). – Sigur Dec 30 '17 at 17:07
  • @sigur I'm not sure I understand what I mean. The double arrow has precisely the same length as the dashed lines. –  Dec 30 '17 at 17:10
  • Make the arc longer to left side and it should tangent the arrow. But it looks like going to cross the arrow. – Sigur Dec 30 '17 at 17:11
  • @Sigur Shifted the arrow correctly (I think). Thanks! However, I do not think that the continuation of the arc should hit the arrow at its tip. Rather, one should shift by -r (\cos \theta,\sin\theta), I think. –  Dec 30 '17 at 17:17
  • This could help you to understand what I mean: https://tex.stackexchange.com/q/14901/14757 – Sigur Dec 30 '17 at 17:22
  • @Sigure Yes, it supports what I did. Look at the arrow labelled 2 in the accepted answer. The arrow is shifted in the direction orthogonal to the line the length of which it should indicate. I did the same. –  Dec 30 '17 at 17:26
3

Simplifying Bernard's code for fun!

\documentclass[pstricks,12pt]{standalone}
\usepackage{pst-eucl}

\psset{shortput = nab}

\begin{document}
\begin{pspicture}(-5,-2)(5,5)
\pstGeonode[PosAngle={-90,30,90,150},PointName={A, \rlap{$B_1\;(x_{b_1}{,}y_{b_1})$}, B, \llap{$(x_{b_2}{,}y_{b_2})\; B_2$}}, PointNameSep=12pt]
(0,0){A}(3; 65){B1}(3; 90){B}(3; 115){B2}
\uput{1.5em}[d](A){$ (x_ a ,y_a) $}
\uput{1.5em}[u](B){$ (x_ b ,y_b) $}
\pstArcOAB{A}{B1}{B2}
\ncline{A}{B}
\psline[linestyle = dashed, linewidth = 0.5pt](B1)(A)(B2)
\ncline[arrows = |<->|, offset = 10pt]{A}{B2}^{$ R $}
\pstMarkAngle[MarkAngleRadius=1,LabelSep=1.5]{B1}{A}{B}{$\theta$}
\end{pspicture}
\end{document} 

enter image description here

Display Name
  • 46,933