I hope everyone is well.
I've been working on a project, and part of it requires me sketch a rather complicated composite function (two or more functions in one). Here is the code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage[bottom]{footmisc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.8}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\onehalfspacing
\rmfamily
\setlength{\parindent}{0pt}
\usepackage{geometry}
\geometry{
paper=a4paper,
top=3cm,
bottom=4cm,
left=2.5cm,
right=2.5cm,
headheight=14pt,
footskip=1.2cm,
headsep=1.2cm,
}
\begin{document}
\begin{figure}[h!]
\centering
\caption{Graph showing the angular radius $\phi$ as a function of angle of the incidence $\theta_i$, for $n_2=1.33$, the general refractive index of water for light (Hecht, 2003):}
\vspace{2mm}
\centering
\begin{tikzpicture}
\begin{axis}[
grid=both,
grid style={line width=.1pt, draw=gray!10},
xmin = 0,
xmax = 2,
ymin = 0,
ymax = 1,
axis lines = middle,
enlargelimits = true,
restrict y to domain=0:2
samples=400
]
\addplot[color = red,domain=0:1.570796327] {(4*asin(0.75187969924 * sin(x))) - 2*sin(x)};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
The key code here is what is being passed into the addplot operator: (4*asin(0.75187969924 * sin(x))) - 2*sin(x), and this is what I am having issues with. It is simply producing the wrong shape. Here is what it should produce, as seen on desmos:
And this is what it produces on LaTeX:
I am using the most recent version of LaTeX on TeXMaker.
I have tried to solve this problem for multiple hours. I have tried using deg() and rad() and nothing, but neither work. Any help to point me in the right direction would be greatly appreciated!
