5

I have already achieved to draw this unit circle. But I want to improve the code, because the intersection point between the circle and the ray is drawn with the command \closeddot{3.875}{0.985};. I need help to improve this and make it "automatic" and mora accurate.

This is my MWE.

\documentclass[border=4pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\newcommand{\opendot}[2]{\filldraw [fill=white,draw=black, thick] ({#1},{#2}) circle (.05) ;}
\newcommand{\closeddot}[2]{\filldraw [fill=black,draw=black, thick] ({#1},{#2}) circle (.05) ;}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[
            axis lines=middle,
            axis equal image,
            enlargelimits,
            xtick=\empty, ytick=\empty,
            data cs=polar,
            samples=100,
            thick
        ]
            \addplot [thick, black, smooth, domain=0:360] {0.8};
            \addplot [thick, blue, -latex, smooth, domain=0:300] {0.3+x/2000} node [pos=0.35, anchor= south] {$\beta$};
        \addplot [thick, black,-latex] coordinates {(0,0) (300,1)};
    \end{axis}
\draw (4.875,0.875) node  {$\left(\frac{1}{2},-\frac{\sqrt{3}}{2}\right)$};
\closeddot{3.875}{0.985};
\end{tikzpicture}
\end{document}

1 Answer 1

5

You can use the intersections library from TikZ:

\documentclass[border=4pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{intersections}

\begin{document}

\begin{tikzpicture}
  \begin{axis}[
      axis lines=middle,
      axis equal image,
      enlargelimits,
      xtick=\empty, ytick=\empty,
      data cs=polar,
      samples=100,
      thick,
      clip=false
  ]

  \addplot [name path=circle,thick, black, smooth, domain=0:360] {0.8};
  \addplot [thick, blue, -latex, smooth, domain=0:300] {0.3+x/2000} node [pos=0.35, anchor= south] {$\beta$};
  \addplot [name path=ray,thick, black,-latex] coordinates {(0,0) (300,1)};
  \path[name intersections={of=ray and circle,by={a}}];   
  \filldraw (a) circle [radius=2pt] ;
  \node[right=6pt,yshift=-2pt] at (a) {$\left(\frac{1}{2},-\frac{\sqrt{3}}{2}\right)$};
  \end{axis}

\end{tikzpicture}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .