# Designing the Uniform Stochastic Photomatrix Therapeutic Systems
## 2 Theory
\begin{array}{ll}\sin\varphi_{1}=2\sin(i\xi)\cdot\sin(\theta_{i}/2) \sqrt{1-\sin^{2}(i\xi)\cdot\sin^{2}(\theta_{i}/2)};&\cos\varphi_{i}=\sqrt{1- \sin^{2}\varphi_{1}}\\ \sin\varphi_{2}=2\cos(i\xi)\cdot\sin(\theta_{i}/2)\sqrt{1-\cos^{2}(i\xi) \cdot\sin^{2}(\theta_{i}/2)};&\cos\varphi_{2}=\sqrt{1-\sin^{2}\varphi_{2}} \end{array} \right. \tag{23}\]  
Next, after all the aforementioned assignments, it is time to introduce the rotation matrices used for calculation when transferring the coordinate system. These are determined by the following mathematical forms:  
\[\Phi_{1}=\left[ \begin{array}{ccc}1&0&0\\ 0&\cos(i\xi)&\sin(i\xi)\\ 0&-\sin(i\xi)&\cos(i\xi)\end{array} \right]\text{; }\Phi_{2}=\left[ \begin{array}{ ccc}\cos\theta_{i}&\sin\theta_{i}&0\\ -\sin\theta_{i}&\cos\theta_{i}&0\\ 0&0&1\end{array} \right]\text{; }\Phi_{3}=\left[ \begin{array}{ccc}1&0&0\\ 0&\cos(i\xi)&-\sin(i\xi)\\ 0&\sin(i\xi)&\cos(i\xi)\end{array} \right] \tag{24}\]  
In the case when in these matrices \(i\cdot\xi=90^{\circ}\), then the original Expression (22) used to move the coordinate system can be represented as the following transformation:  
\[\left[ \begin{array}{c}x_{i,j+1}\\ y_{i,j+1}\\ z_{i,j+1}\end{array} \right]=[\Phi_{3}]\cdot[\Phi_{2}]\cdot[\Phi_{1}]\cdot \left[ \begin{array}{c}x_{i,j}\\ y_{i,j}\\ z_{i,j}\end{array} \right]+\left[ \begin{array}{c}-R_{s}\sin\theta_{i}\\ 0\\ R_{s}(1-\cos\varphi_{i})\end{array} \right] \tag{25}\]  
Thus, after transitions to the \(i\)-th parallel circle from the previous one the first step is the moving along with an angular displacement \(\psi_{i}\) between those parallels, and only after that will one by one calculation take place for the value of angle \(\theta_{i}\) between adjacent LEDs of spherical PMTS. As a result, using the sequential transformations described above, the illuminance of the biotissues can be calculated for three main types of PMTS. At the same time, more complicated biological surfaces may be considered as a combination for these three PMTS types, and so the illuminance in this case can be calculated as well. As noted at the beginning of this section, one of the main advantages of the PMTS over all other light sources is the integral spatial irradiation of extended biological surfaces having any skin relief. The methodology proposed above makes it possible to create a PMTS in which the LED sources are not located unsystematically or by chance, but in a certain order in accordance with the mathematical and engineering calculation algorithm. Thus, by strictly following the spatial mathematical model for calculating the placement of each LED, it will be possible to create such PMTS that will completely satisfy the properties of absolute uniform irradiation of the body surface with the same intensity over the entire irradiated area. Furthermore, it should be emphasized that the algorithm proposed above describes how to create uniform spatial illuminance, which is true for a constant mode of the LED irradiation. However, this mode of PMTS operation is only the initial basic mode; all other regimes that were indicated in the Introduction section of this article are pulse-generated. The most complex of them is the stochastic mode, the implementation of which is not a trivial task, and thus has still not been fully solved in LED phototherapy. The questions regarding this issue are considered in the next sections.