Spatial Audio (Ambisonic) and calculating sound source position I have 4ch Spatial Audio (Ambisonic) WAV file and I want to calculate sound source position and put it on 2D plane.

What I know so far is the following:

WAV file consists of signals that support of 360 video playback


Channel 1 = omnidirectional sphere (named W: $w(t) = p(t)$)
Channel 2 = left-right dipole (named Y: $y(t) = \sqrt{2}p(t)\sin(a)\cos(b)$)
Channel 3 - has no data
Channel 4 = front-back dipole (named X: $x(t) = \sqrt{2}p(t)\cos(a)\cos(b)$)


How to calculate sound source position at any point of time using these data?

Edit:

calculation like this gives mess:

theta = Math.Atan2(y, x);
px = r * Math.Cos(theta);
py = r * Math.Sin(theta);


Edit 2:

So imagine we have Spatial Audio/Ambisonic/B-Format WAV file 
and we need to draw/visualize a microphone in the center of screen and a sound source around the microphone at any time reading WAV file

Edit 3:

We use H2n SPATIAL AUDIO mode that gives 1 WAV file with 4 Channel
Using the suggested wiki-formula here is our result for first 1000 ticks using MatLab (does not look proper):
I know nothing about Ambisonic decoding, but the Wikipedia page suggests:
$$
p(\theta_n) = w(t) + x(t) \cos(\theta_n) + y(t) \sin(\theta_n)
$$
Perhaps you could form that and vary $\theta_n$ to find the direction of highest power?

Note: I realize that's not what the page is really saying. It's saying that this is the signal to feed to a speaker at $\theta_n$... but that seems similar to finding the directionality of the source.  Also note that it does not find the distance of the source, just the $x-y$ plane angle.