## 3 Approximate Inverse Kinematics Solution for Imposed End-Effector State
### Calculation of Arc Segments' Endpoints and Orientations
However, the direction in the workspace is the same as the vector's \(\mathbf{p}_{\text{ecl}}\) direction:  
Figure 6:2Vector \(\mathbf{p}_{\text{Nec1}}\) gets new values for its coordinates \(x_{\text{1 Norm}}\) and \(y_{\text{1 Norm}}\). Length-invariant direction adaptation of the scaled vector \(\mathbf{p}_{\text{Nec1}}\) is still necessary. It should rotate in the \(x\)-\(y\) plane to a new vector \(\mathbf{p}_{1}\), which defines the final first robot segment endpoint (Figure 8). To do so, triangle \(\Delta OB_{1}P_{1}\) returns the magnitude of \(\mathbf{b}_{1}\), as in Figure 6:3  
Figure 6:4  
Figure 6:5  
Substituting Equations (17) and (18) into Equation (28) and simplifying \(\mathbf{b}_{1}\) yields  
Figure 6:6  
Figure 6:7 Robot first segment, when a segment’s form is an arc, endpoint \(P_{1}\) representation: (**a**) the point \(P_{1}\) with approximate spine curve view; (**b**) points \(P_{1}\) and \(\hat{P}_{\text{ec1}}\), zoomed in. Figure 6:8 The first segment vector \(\mathbf{p}_{\text{ec1}}\) normalization and scaling to the new vector \(\mathbf{p}_{\text{Nec1}}\): (**a**) vectors \(\mathbf{p}_{\text{ec1}}\) and \(\mathbf{p}_{\text{Nec1}}\) with approximate bent robot spine curve view; (**b**) vectors \(\mathbf{p}_{\text{ec1}}\) and \(\mathbf{p}_{\text{Nec1}}\) endpoints, zoomed in. Normalization of \(\mathbf{p}_{\text{Nec1}}\) and scaling it to the magnitude \(\mathbf{b}_{1}\) produces new \(x_{1}\), \(y_{1}\) values:  
Figure 6:9  
\[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]0  
Combining coordinates \(x_{1}\), \(y_{1}\), \(z_{1}\) enables the expression of the first segment endpoint \(P_{1}\). Then, the segment is in a standard arc form, as follows:  
\[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]1  
The first segment endpoint's \(P_{1}\) coordinates have already been obtained. Point \(P_{1}\) and bending angle \(\theta_{1}\) fully express the robot's first segment. The segment rotation angle \(\varphi_{1}\) around the \(z\)-axis in Figure 3a is unnecessary. The approach of finding the parameters of the second and third segments will use the quaternion technique. This method requires knowledge of the orientation of the previous segment. In this case, the retrieval of the second segment's parameters requires knowledge of the first segment's orientation. Initially, for the calculation of the first segment arc center point \(C_{1}\) (Figure 8a), there is a need to define the circle arc radius with the formula  
\[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]2  
Then, point \(C_{1}\) coordinates estimation yields  
\[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]3 \[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]4 (35) \[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]5  
where \(z_{\text{c1}}=0\), because the first segment arc's center must lie on the \(x\)-\(y\) axis plane. In Equations (34)-(36), the coordinates all denote  
\[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]6  
Quaternions will allow for estimation of the first segment's orientation. The calculation starts with finding an axis around which a unit vector defines the first segment orientation rotation. To get this, arc center point \(C_{1}\) needs to be rotated around the \(z\)-axis \(90^{\circ}\) counter-clockwise (Figure 9). The definition of the quaternion's axis vector is as follows:  
\[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]7  
By using vector normalization and scaling, as in Equation (22), the vector \(\mathbf{c}_{\text{r1}}\) magnitude yields a unit vector \(\overset{\boldsymbol{\wedge}}{\mathbf{c}_{\text{r1}}}\)  
\[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]8  
Quaternion \(q\) expresses rotation around the unit vector axis \(\overset{\rightarrow}{OC}_{un1}\) through the angle \(\theta_{1}\), with  
\[r_{n}=\frac{L}{\theta_{n}}. \tag{16}\]9For any unit vector that will express first segment orientation and rotation, a rotation matrix \(\mathbf{R}_{n}\) exists. This rotation matrix rotates any vector by an angle \(\theta_{n}\) counter-clockwise (right-hand rule) by using  
\[\mathbf{R}_{n}=\left[