Digital Panning Effect To get a panning effect I know that there is a need for a Circular Matrix. 
The angle is can be set as a default or I can let the user to select the angle. 

So if the angle is $\theta$, the circular matrix will be: 

$$
\begin{pmatrix}\cos \theta &amp; \sin \theta \\ -\sin \theta &amp; \cos \theta\end{pmatrix}
$$
and the gain is actually set in which channel (Right or Left) the audio will be.

So if I'm sampling the signal from a guitar and get the sequence $X$,
all I need to do is to do is to multiply each sample value with the circular matrix?

This operation (multiply each sampled value with the circular matrix) calculates the gain right? So I will know in which channel - right or left to play the signal.

I don't understand when the signal is converted again to analog. After the calculation of the gain? Because if you play with a panning effect, you will hear the sound in the left or the right channel very fast. 

I don't understand if it's a multiplication the whole signal with the circular matrix and then just playing it back on the different channels. Or is it actually a multiplication of each sampled value of the signal by the matrix, conversion to analog and then processing of  other sampled values.
To get a panning effect I know that there is a need for a Circular Matrix. The angle is can be set as a default or I can let the user to select the angle.


How do you know this? Can you cite a source? Audio Panning is typically done with one input and two outputs. It's either done with constant energy or constant amplitude pan. Constant energy is similar to what the second column of your matrix would do if the angle goes from 0 to 90 degree with 45 degrees being "centered"