Could you help me to understand this expression y = tan(yx)? Desmos.com renders it like image below:
I am trying to write a function to do similar in JavaScript. To do so, I have to rearrange it in this way:
y = tan(xy) tan-1(y) = xy x = tan-1(y)/y
But, this expression only draws the middle line? What am I doing wrong?
Need to understand how to rearrange y=tan(xy) expression to get something similar to the first illustration with JavaScript or any other programming language.


To elaborate on Davids answer, we consider standard $\tan^{-1}(x)$ function $\Bbb R \to (-\frac{\pi}{2}, \frac{\pi}{2})$. From the equation $y = \tan(yx)$ you can very well say
$$\tan^{-1}(y) = \tan^{-1}(\tan(yx))$$
Now we cannot simplify right side to simply $yx$! Now since the range of $\tan^{-1}()$ is $(-\frac{\pi}{2}, \frac{\pi}{2})$, $\tan^{-1}(\tan(yx)) = yx$ if and only $yx \in (-\frac{\pi}{2}, \frac{\pi}{2})$.
For other values of $yx$, say if $yx \in (\frac{\pi}{2}, \frac{3\pi}{2})$ then $yx - \pi \in (-\frac{\pi}{2}, \frac{\pi}{2})$. Thus for this we get $$\tan^{-1}(\tan(yx))= \tan^{-1}(\tan(yx-\pi)) = yx - \pi$$
Similarly say $yx \in (-\frac{3\pi}{2}, -\frac{\pi}{2})$ then $yx+\pi \in (-\frac{\pi}{2}, \frac{\pi}{2})$ and so $$\tan^{-1}(\tan(yx))= \tan^{-1}(-\tan(yx+\pi)) = -yx - \pi$$