# Fast 3D Analytical Affine Transformation for Polygon-Based Computer-Generated Holograms
## 2 Conventional Polygon-Based Method  
Figure 1 shows the basic principle of the polygon-based method. The surface of a 3D object is discretized into many polygons (usually triangles). The hologram is assumed to be on the plane \(z=0\). The total complex field distribution on the hologram plane \(f_{HOLO}(x,y,z=0)\) can be expressed as the superposition of the polygon fields from each polygon, \(f_{HOLO,i}(x,y)\):  
\[f_{HOLO}(x,y)=\sum_{i=1}^{N}f_{HOLO,i}(x,y), \tag{1}\]  
where \(N\) is the number of polygons and \(f_{HOLO,i}(x,y)\) is the complex field on the hologram plane from the \(i\)th polygon. Since the complex field distribution of each triangle on the hologram can be expressed by the inverse Fourier transform of its spectrum:  
\[f_{HOLO,i}(x,y)=\mathcal{F}^{-1}\{F_{HOLO,i}(u,v)\}, \tag{2}\]  
where \(\mathcal{F}^{-1}\{\cdot\}\) represent the inverse Fourier transform and \(F_{HOLO,i}(u,v)\) represents the spectrum of the \(i\)th polygon on the hologram. Therefore, the key to the polygon-based method is how to obtain the spectrum of each triangle on the hologram plane. As shown in Figure 2, a polygon on the source coordinate system \((x_{s},y_{s},z_{s})\) is not necessarily parallel to the hologram plane \((x,y)\); one needs to rotate the polygon to parallel local coordinate system \((x_{p},y_{p},z_{p})\) to be parallel to the hologram plane in order to calculate the diffracted field toward the hologram through standard diffraction theory [6]. The spatial frequencies \((u_{s},v_{s})\) can be expressed as:  
\[u_{s}=a_{1}u_{p}+a_{2}v_{p}+a_{3}w_{p}, \tag{3a}\] \[v_{s}=a_{4}u_{p}+a_{5}v_{p}+a_{6}w_{p}, \tag{3b}\]  
where \(a_{i}\) are the elements of the rotation matrix. \((u_{s},v_{s})\) (corresponding to \(\left(k_{sx},k_{sy}\right)\) in Equation (10a,b) in Ref. [8]) are the spatial frequencies corresponding to source coordinates \((x_{s},y_{s},z_{s})\). \(\left(u_{p},v_{p},w_{p}\right)\) (corresponding to \(\left(k_{px},k_{py},k_{pz}\right)\) in Equation (10a,b) in Ref. [8]) are spatial frequencies corresponding to parallel local coordinates \(\left(x_{p},y_{p},z_{p}\right)\). Upon a differential operation in Equation (3a), we have:  
\[\Delta u_{s}=a_{1}\Delta u_{p}+a_{2}\Delta v_{p}+a_{3}\Delta w_{p}=a_{1}\Delta u _{p}+a_{2}\Delta v_{p}-a_{3}.\frac{\left(u_{p}\cdot\Delta u_{p}+v\cdot\Delta v _{p}\right)}{\sqrt{\frac{1}{\lambda^{2}}-{u_{p}}^{2}-{v_{p}}^{2}}}, \tag{4}\]  
where \(w_{p}=\sqrt{\frac{1}{\lambda^{2}}-{u_{p}}^{2}-{v_{p}}^{2}}\) with \(\lambda\) being the wavelength of the light source. Since the spatial frequencies \(\left(u_{p},v_{p}\right)\) are uniformly distributed, we have \(\Delta u_{p}=constant\), \(\Delta v_{p}=constant\). For simplicity, let us assume \(\Delta u_{p}=1,\Delta v_{p}=1\), and Equation (4) then can be rewritten as follows:  
Figure 1: Principle of the polygon-based method. \[\Delta u_{s}=a_{1}+a_{2}-a_{3}.\frac{\left(u_{p}+v_{p}\right)}{\sqrt{\frac{1}{ \lambda^{2}}-u_{p}{}^{2}-v_{p}{}^{2}}}\
eq\text{constant}. \tag{5}\]  
Since \(\Delta u_{s}\)(the derivative of \(u_{s}\)) is not constant, Equation (5) indicates that for an arbitrary set of spatial frequencies \(\left(u_{p},v_{p}\right)\) corresponding to the parallel local coordinates, spatial frequency \(\left(u_{s},v_{s}\right)\) after rotation has highly nonlinear properties. Because uniform sampling is necessary for the FFT to work correctly in the traditional method, interpolation process is required for spatial frequencies \(\left(u_{s},v_{s}\right)\) after rotation. This procedure would add substantially to the computational time [30]. Comparing with the traditional method, the analytical method avoids the use of the FFT in obtaining the spectrum of the polygon in the source coordinates and the interpolation process is therefore not required. The analytical method can obtain the analytical expression of the tilted triangle spectrum directly by using affine transformation and a given spectrum expression of a primitive triangle.