So I am trying to replicate the following image in latex. The following are what I am finding hard to achieve:
- how do you draw a little hollow circle to mean we have right-angled triangle like the image I am trying to copy?
- how do you draw a red circular arrow starting from the x-axis to the hypotenius of the triangle like the image?
- Why is the circle broken around the x-axis?
Many thanks guys
\documentclass[11.5pt]{article}
\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\sectionmark}[1]{\markright{#1}} %Gets rid of section number in the header%
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[margin=0.5in]{geometry}
\usepackage{pgfplots}
\usepackage{array}
\usepackage{float}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage{bigints}
\usepgfplotslibrary{fillbetween}
\usepackage{subcaption}
\usepackage{pstricks}
\usepackage{fancyheadings}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{blindtext} %% to add dummy text
\renewcommand{\contentsname}{Table Of Contents}%
\begin{document}
\setlength{\parindent}{0cm}
\pgfplotsset{every axis/.append style={
axis x line=middle, % put the x axis in the middle
axis y line=middle, % put the y axis in the middle
axis line style={<->}, % arrows on the axis
xlabel={$x$}, % default put x on x-axis
ylabel={$y$}, % default put y on y-axis
title={$ $},
ticks=none
}}
% arrows as stealth fighters
\tikzset{>=stealth}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
xmin=-3,xmax=3,
ymin=-2.5,ymax=2.5,
]
\node [below] at (axis cs: 0.2, 0) {$O$};
\node [left] at (axis cs: -1.5, 1.3228) {$P$};
\node [below] at (axis cs: -0.7, 0) {$x$};
\node [left] at (axis cs: -1.5, 0.6) {$y$};
\node [above] at (axis cs: -0.7, 0.7) {$r$};
\node [right] at (axis cs: 0, 0.2) {$\theta$};
\plot[thick][samples=200,domain=-2.3:2.3] {sqrt(4-x^2)};
\plot[thick][samples=200,domain=-2.3:2.3] {-sqrt(4-x^2)};
\plot[ultra thick][samples=200,domain=-1.5:0] {0};
\plot[ultra thick][samples=200,domain=-1.5:0] {-0.881866*x};
\draw[style=ultra thick](axis cs:-1.5,0) -- (axis cs:-1.5,1.3228);
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}