# Algorithmic Modified Denavit-Hartenberg Modeling for Robotic Manipulators Using Line Geometry
## 3 Line Geometry
### Feet of Common Perpendicular Line  
The aforementioned intersection points (or feet) \(t_{1}\) and \(t_{2}\) in Figure 4 can be found through the following procedures. In fact, the related proof can be found in [25] as well. To begin with, let us set up a coordinate frame \(\hat{z}_{1}\)-\(\hat{n}\) at the origin (\(0\)) as shown in Figure 5, which is composed of three perpendicular unit vectors \(\hat{z}_{1}\), \(\hat{n}=\frac{\hat{z}_{1}\times\hat{z}_{2}}{\|\hat{z}_{1}\times\hat{z}_{2}\|}\), and \(\hat{u}=\hat{n}\times\hat{z}_{1}\). The basic idea in [25] is to project the point \(t_{2}\) onto the coordinate frames \(\hat{z}_{1}\)-\(\hat{n}\) in Figure 5 as follows:  
\[t_{2}=(t_{2}\cdot\hat{z}_{1})\hat{z}_{1}+(t_{2}\cdot\hat{u})\hat{u}+(t_{2} \cdot\hat{n})\hat{n}. \tag{21}\]  
For the third term \((t_{2}\cdot\hat{n})\) of the right-hand side of Equation (21), we can observe the following:  
\[t_{2}\cdot\hat{n}=-\frac{v_{2}\cdot\hat{z}_{1}}{\|\hat{z}_{1}\times\hat{z}_{2 }\|}. \tag{22}\]  
For the second term \((t_{2}\cdot\hat{u})\), the definitions of \(\hat{u}\) and \(\hat{n}\) are used as follows:  
\[t_{2}\cdot\hat{u}=-v_{1}\cdot\hat{n}. \tag{23}\]  
For the first term \((t_{2}\cdot\hat{z}_{1})\), the direction vector \(\hat{z}_{2}\) lies in the plane spanned by \(\hat{z}_{1}\) and \(\hat{u}\) as shown in Figure 5, such that  
\[\hat{z}_{2} =(\cos\alpha)\hat{z}_{1}+(\sin\alpha)\hat{u}\] \[=(\hat{z}_{1}\cdot\hat{z}_{2})\hat{z}_{1}+\|\hat{z}_{1}\times\hat {z}_{2}\|\hat{u}.\]  
then, using Equation (23), we have:  
\[t_{2}\cdot\hat{z}_{2}=(\hat{z}_{1}\cdot\hat{z}_{2})(t_{2}\cdot\hat{z}_{1})-v _{1}\cdot(\hat{z}_{1}\times\hat{z}_{2}). \tag{24}\]  
Figure 5: \(\hat{z}_{1}\)-\(\hat{n}\)-\(\hat{n}\) coordinate frame, where \(\hat{z}_{2}\) lies in the \(\hat{z}_{1}\)-\(\hat{u}\) plane, and thus \(\sin\alpha=\|\hat{z}_{1}\times\hat{z}_{2}\|\) and \(\cos\alpha=\hat{z}_{1}\cdot\hat{z}_{2}\) for \(0\leq\alpha\leq\pi\).  
Also, from the following:  
\[\hat{z}_{2}\times v_{2}=t_{2}-(\hat{z}_{2}\cdot t_{2})\hat{z}_{2},\]  
\(t_{2}\) is obtained as:  
\[t_{2}=\hat{z}_{2}\times v_{2}+(\hat{z}_{2}\cdot t_{2})\hat{z}_{2}.\]  
Then using Equation (24), \((t_{2}\cdot\hat{z}_{1})\) is derived using \((t_{2}\cdot\hat{z}_{2})\):  
\[t_{2}\cdot\hat{z}_{1}=v_{2}\cdot(\hat{z}_{1}\times\hat{z}_{2})+(\hat{z}_{1} \cdot\hat{z}_{2})^{2}(t_{2}\cdot\hat{z}_{1})-(\hat{z}_{1}\cdot\hat{z}_{2})(v_{ 1}\cdot(\hat{z}_{1}\times\hat{z}_{2})),\]  
since \((t_{2}\cdot\hat{z}_{1})\) appears in both sides of the above equation, rearranging it yields  
\[t_{2}\cdot\hat{z}_{1}=\frac{(v_{2}-(\hat{z}_{1}\cdot\hat{z}_{2})v_{1})\cdot \hat{n}}{\|\hat{z}_{1}\times\hat{z}_{2}\|}. \tag{25}\]  
By inserting the three terms of Equations (22), (23), and (25) into Equation (21), finally, we have \(t_{2}\), using \(a\times(b\times c)=(a\cdot c)b-(a\cdot b)c\) and \(\hat{n}=\frac{\hat{z}_{1}\times\hat{z}_{2}}{\|\hat{z}_{1}\times\hat{z}_{2}\|}\), as following form:  
\[t_{2}=\frac{v_{2}\times(\hat{z}_{1}\times(\hat{z}_{1}\times\hat{z}_{2}))-(v_{ 1}\cdot(\hat{z}_{1}\times\hat{z}_{2}))\hat{z}_{2}}{\|\hat{z}_{1}\times\hat{z} _{2}\|^{2}}. \tag{26}\]  
On the other hand, \(t_{1}\) is obtained from Equation (26) for \(t_{2}\) by switching subscripts 1 and 2, as follows:  
\[\therefore t_{1}=\frac{v_{1}\times(\hat{z}_{2}\times(\hat{z}_{2}\times\hat{z}_{1 }))-(v_{2}\cdot(\hat{z}_{2}\times\hat{z}_{1}))\hat{z}_{1}}{\|\hat{z}_{1}\times \hat{z}_{2}\|^{2}}. \tag{27}\]  
It is noted that the derived \(t_{1}\) and \(t_{2}\) are computed by using the information only on two lines \(L_{1}(\hat{z}_{1},v_{1})\) and \(L_{2}(\hat{z}_{2},v_{2})\). The next section summarizes the five results of line geometry such as link length \(a\) (17), link twist \(\alpha\) (18), \(\hat{x}\)-axis \(\hat{n}\) (19), and feet of common perpendicular line \(t_{2}\) (26) and \(t_{1}\) (27).