## 4 Path Tracking
### Trajectory Blending  
As shown in Figure 7, Lame curve \(\mathrm{C}_{1}\) is defined by the above equation. Affine transformations are implemented on Lame curve \(\mathrm{C}_{1}\) to conform the derived shape and location in frame \(\mathcal{F}\). In this way, a smooth trajectory is generated, tangent to both the \(Y\)-axis and the path at points \(C\) and \(T_{k}\), the tangent lines intersecting at point \(M_{k}\). The homogeneous coordinates of the Lame curve \(\mathrm{C}_{j}\) (\(j=1,\,2,\,3,\,4\)) and the trajectory are stored in arrays \(\mathbf{p}_{j}\) and \(\mathbf{p}_{5}\). The rotation, the homogeneous scaling and displacement matrices are \(\mathbf{R}(\varphi)\), \(\mathbf{S}(s_{x},s_{y})\) and \(\mathbf{D}\). The first two matrices are given below:  
\[\mathbf{R}(\varphi)\equiv \begin{bmatrix}\cos\varphi&-\sin\varphi&0\\ \sin\varphi&\cos\varphi&0\\ 0&0&1\end{bmatrix} ,\quad\mathbf{S}(s_{x},s_{y})\equiv \begin{bmatrix}S_{x}&0&0 \\ 0&S_{y}&0\\ 0&0&1\end{bmatrix} \]  
Figure 6: Path tracking based on trajectory blending. Figure 7: Affine transformations of Lame curves for tracking. The corresponding transformation procedure follows:  
1. Rotate Lame curve C\({}_{1}\) through \(\pi/4\) around point \(C\) counterclockwise to obtain Lame curve C\({}_{2}\). Hence, the parametric equation of Lame curve C\({}_{2}\) can be obtained by using the rotation transformation from that of curve C\({}_{1}\), i.e., \(\mathbf{p}_{2}=\mathbf{R}(\pi/4)\mathbf{p}_{1}\), where \(\mathbf{p}_{1}\) and \(\mathbf{p}_{2}\) are the position vectors of an arbitrary point on the parametric equations of Lame curves C\({}_{1}\) and C\({}_{2}\), respectively. 2. Conform Lame curve C\({}_{2}\) to curve C\({}_{3}\) in order to make the difference of the orientation angles \(\angle A_{3}E_{3}B_{3}=2\psi\). Since \(y_{3}=y_{2}\) and \(x_{3}=x_{2}\tan\psi\), the parametric equation of Lame curve C\({}_{3}\) can be obtained by using the scaling transformation from that of curve C\({}_{2}\), i.e., \(\mathbf{p}_{3}=\mathbf{S}_{\psi}(\tan\psi,1)\mathbf{p}_{2}\), as shown in Figure 8, with \(\mathbf{p}_{3}\) defined as the position vector of an arbitrary point on Lame curve C\({}_{3}\). For this curve, two tangent lines stemming from points \(A_{3}\) and \(B_{3}\) meet at point \(E_{3}\) (coinciding with \(E_{2}\)), at an angle \(\angle A_{3}E_{3}B_{3}=\angle CM_{k}T_{k}\). 3. Isotropically scale (An isotropic planar scaling is a resizing of a planar figure by means of identical scalar factors in two orthogonal directions.) Lame curve C\({}_{3}\) to curve C\({}_{4}\) according to the distance \(l_{2}\). Letting the scaling factor be \(k_{1}\), and the length of segment \(\overline{B_{3}E_{3}}\) be \(l_{0}\), \(k_{1}=l_{2}/l_{0}\). Hence, the parametric equation of Lame curve C\({}_{4}\) can be obtained by using the isotropically scaling transformation from that of curve C\({}_{3}\), i.e., \(\mathbf{p}_{4}=\mathbf{S}_{k}(k_{1},k_{1})\mathbf{p}_{3}\), with \(\mathbf{p}_{4}\) defined as the position vector of an arbitrary point on Lame curve C\({}_{4}\). It is noteworthy that isotropic scaling changes the size of Lame curve C\({}_{3}\) but preserves its shape, i.e., the length of segment \(\overline{B_{4}E_{4}}\) is changed to \(l_{2}\), while \(\angle A_{4}E_{4}B_{4}\) remains equal to \(\angle A_{3}E_{3}B_{3}\). In this step, Lame curve C\({}_{4}\) has the size and shape required by the final trajectory. 4. Displace Lame curve C\({}_{4}\) to the final trajectory, making points \(B_{4}\), \(E_{4}\) and \(A_{4}\) coincide with points C, \(M_{k}\) and \(T_{k}\), respectively. Store the homogeneous coordinates of points \(B_{j}\), \(E_{j}\), \(A_{j}\), \(C\), \(M_{k}\) and \(T_{k}\) into arrays \(\mathbf{b}_{j}\), \(\mathbf{e}_{j}\), \(\mathbf{a}_{j}\), \(\mathbf{c}_{k}\), \(\mathbf{m}_{k}\) and \(\mathbf{t}_{k}\), respectively.