## 3 Positioning Method
### Coordinate Distance Estimation  
The proposed system measures the coordinate distance from the ceiling LED lights and smartphone image sensor. The LED lights were attached to the ceiling, and the distance between the ceiling LEDs and the ground was constant for every positioning point in the indoor environment. The smartphone image sensor was moved in under the LED lighting infrastructure. In our system, we demonstrated with at least three and more than three LED lights within the camera FOV where the LEDs were continuously transmitting their coordinate information using visible light technology to the smartphone image sensor. We assumed that the ceiling LED transmitters coordinates along the \(x\), \(y\), and \(z\) axis directions (\(x_{n}\), \(y_{n}\), \(z_{n}\)) and the image sensor coordinate on the image plane (\(x^{\prime}\),\(y^{\prime}\),\(z^{\prime}\)). Therefore, after receiving all of the coordinate information from the ceiling LED lights by the smartphone CMOS image sensor, the distance \(L_{n}\) from the \(n\) LEDs and image sensor is expressed as:  
\[L_{n}^{2}=\left(x^{\prime}-x_{n}\right)^{2}+\left(y^{\prime}-y_{n}\right)^{2}+ \left(z^{\prime}-z_{n}\right)^{2} \tag{9}\]  
If the coordinate information is received from the \(L_{n}\) = 4 number of ceiling LED light transmitters, then we can evaluate Equation (9) as follows:  
\[\left\{\begin{array}{l}L_{1}^{2}=\left(x^{\prime}-x_{1}\right)^{2}+\left(y^ {\prime}-y_{1}\right)^{2}+\left(z^{\prime}-z_{1}\right)^{2}\\ L_{2}^{2}=\left(x^{\prime}-x_{2}\right)^{2}+\left(y^{\prime}-y_{2}\right)^{2}+ \left(z^{\prime}-z_{2}\right)^{2}\\ L_{3}^{2}=\left(x^{\prime}-x_{3}\right)^{2}+\left(y^{\prime}-y_{3}\right)^{2}+ \left(z^{\prime}-z_{3}\right)^{2}\\ L_{4}^{2}=\left(x^{\prime}-x_{4}\right)^{2}+\left(y^{\prime}-y_{4}\right)^{2}+ \left(z^{\prime}-z_{4}\right)^{2}\end{array}\right. \tag{10}\]  
By simplifying Equation (10), we obtain a matrix form that can be generated in Equation (11), which shows the relationship of the calculated positions and the measured distances between the LED transmitter and images sensor receiver:  
\[\left[\begin{array}{ccc}1-2x_{1}&-2y_{1}&-2z_{1}\\ 1-2x_{2}&-2y_{2}&-2z_{2}\\ 1-2x_{3}&-2y_{3}&-2z_{3}\\ 1-2x_{4}&-2y_{4}&-2x_{4}\end{array}\right]\left[\begin{array}{c}x\prime^{2} +y\prime^{2}+z\prime^{2}\\ x\prime\\ y\prime\\ z\prime\end{array}\right]=\left[\begin{array}{c}L_{2}^{2}-x_{2}^{2}-y_{2}^ {2}-z_{2}^{2}\\ L_{2}^{2}-x_{2}^{2}-y_{2}^{2}-z_{2}^{2}\\ L_{3}^{2}-x_{3}^{2}-y_{3}^{2}-z_{3}^{2}\\ L_{4}^{2}-x_{4}^{2}-y_{4}^{2}-z_{4}^{2}\end{array}\right] \tag{11}\]  
Hence, available from Equation (11), (\(x^{\prime},y^{\prime},z^{\prime}\)) can be acquired from the following form:  
\[M\cdot x=S \tag{12}\]where  
\[M=2.\left(\begin{array}{ccc}x_{1}-x_{2}&y_{1}-y_{2}&z_{1}-z_{2}\\ x_{1}-x_{3}&y_{1}-y_{3}&z_{1}-z_{3}\\ x_{1}-x_{4}&y_{1}-y_{4}&z_{1}-z_{4}\\ \end{array}\right),\]  
\[x=\left(\begin{array}{c}x\prime\\ y\prime\\ z\prime\end{array}\right),\]  
\[S=\left(\begin{array}{ccc}L_{2}^{2}-L_{1}^{2}+x_{2}^{2}-x_{2}^{2}+y_{1}^{2}- y_{2}^{2}+z_{1}^{2}-z_{2}^{2}-z_{2}^{2}\\ L_{3}^{2}-L_{1}^{2}+x_{1}^{2}-x_{3}^{2}+y_{1}^{2}-y_{3}^{2}+z_{1}^{2}-z_{3}^{2} \\ L_{4}^{2}-L_{1}^{2}+x_{1}^{2}-x_{4}^{2}+y_{1}^{2}-y_{4}^{2}+z_{1}^{2}-z_{4}^{2} \\ \end{array}\right)\]  
The solution of \(x\) from Equation (12) obtained from the least-square estimation method is expressed as:  
\[x=\left(M^{T}M\right)^{-1}M^{T}S \tag{13}\]  
The equation indicates that all the elements of matrix \(\tilde{N}=(M^{T}M)^{-1}M^{T}\) are derived from the transmitter coordinates value only. Therefore, vector \(S\) comprises the measured distance between the unknown coordinate of the image sensor receiver and the coordinates of the LED transmitters.