feat: inverse csc calculator

This commit is contained in:
newt 2024-10-09 18:02:46 +01:00
parent e7a5f21477
commit 1b26e034f7
6 changed files with 34 additions and 3 deletions

View file

@ -35,6 +35,5 @@
"streambuf": "cpp"
},
"latex-workshop.latex.autoBuild.run": "onSave",
"latex-workshop.latex.autoClean.run": "onBuilt",
"latex-workshop.cls"
"latex-workshop.latex.autoClean.run": "onBuilt"
}

View file

@ -18,7 +18,7 @@ arcsin = lambda x: (-i * ln((i * x) + sqrt(1 - pow(x, 2)))).real
# todo: finish arc functions
arccos = lambda x: None
arctan = lambda x: None
arccsc = lambda x: None
arccsc = lambda x: (-i * (ln((pow(x, -1) * i) + sqrt(1 - pow(x, -2))))).real
arcsec = lambda x: None
arccot = lambda x: None

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View file

@ -0,0 +1,32 @@
\documentclass{../style}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{gather*}
\text{By Euler's formula:} \\
e^{i\theta} = cos(\theta) + i\sin(\theta) \\
e^{-i\theta} = cos(\theta) - i\sin(\theta)
\end{gather*}
\begin{gather*}
\therefore \sin(\theta) = \frac{e^{i\theta} - e^{-i\theta}}{2i} \\
\csc(\theta) = \frac{1}{\sin(\theta)} = \frac{2i}{e^{i\theta} - e^{-i\theta}}
\end{gather*}
\begin{gather*}
\text{let} \quad \csc(\theta) = x \\
\frac{2i}{x} = e^{i\theta} - e^{-i\theta} \\
\frac{2i}{x}e^{i\theta} = (e^{i\theta})^2 - 1 \\
(e^{i\theta})^2 + (-\frac{2i}{x})e^{i\theta} - 1 = 0
\end{gather*}
\begin{gather*}
e^{i\theta} = \frac{-(\frac{2i}{x}) \pm \sqrt{(\frac{2i}{x})^2 - 4(1)(-1)}}{2} = x^{-1}i \pm \sqrt{1 - x^2} \\
i\theta = \ln(x^{-1}i \pm \sqrt{1 - x^2}) \\
\theta = -i\ln(x^{-1}i \pm \sqrt{1 - x^2})
\end{gather*}
\begin{gather*}
\therefore \text{arccsc}(\theta) = -i\ln(i\theta^{-1} \pm \sqrt{1 -\theta^2})
\end{gather*}
\end{document}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 39 KiB