## 3 Method
### Algorithmic Approach  
Sometimes it is not an essay task to image the right set of equations for creating a point-cloud using the method described in the previous sub-section. In this case, a point-cloud can be created recursively using an algorithmic approach. [PERSON] et al. (2018) have shown an algorithmic approach where set points are created recursively by two user-defined parameters called distance and angle. We have modified their algorithm to the create point-cloud for geometric modeling. Steps to create a point-cloud based on a recursive process are as Algorithm 1:  
```
1 Define: Center Point \(P_{c}=(P_{cx},P_{cy})\in\Re^{2}\), Length \(d>0\), Initial Angle \(\alpha\in\Re\)
2 Define: Instantaneous Distances (\(r_{i}\in\Re\)\(\mid\)\(i=1,...,n\))
3 Define: Rotational Angles (\(\rho_{i}\in\Re\)\(\mid\)\(i=1,...,n\))
4 Calculate: \(P_{0}=(P_{0x},P_{0y})\) so that \(P_{0x}=P_{cx}+d\cos\alpha\) and \(P_{0y}=P_{cy}+d\sin\alpha\)
5 Iterate: For \(i=1,...,n\)
6 Rotate \(P_{0}\) by an angle \(\rho_{i}\) around \(P_{c}\) in the counter-clockwise direction to create \(P_{i}=(P_{ux},P_{iy})\) so that \(P_{ix}=P_{cx}+(P_{0x}-P_{cx})\cos\rho_{i}-\left(P_{0y}-P_{cy}\right)\sin\rho _{i}\) and \(P_{iy}=P_{cy}+(P_{0x}-P_{cx})\sin\rho_{i}+\left(P_{0y}-P_{cy}\right)\cos\rho _{i}\)
7 Extend \(P_{i}\) to \(P_{ei}\) that is point on the line \(P_{c}P_{i}\) at a distance \(r_{i}\) from \(P_{c}\)
8 \(P_{eix}=P_{cx}+(P_{ix}-P_{cx})\frac{r_{i}}{d}\) and \(P_{eiy}=P_{cy}+\left(P_{iy}-P_{cy}\right)\frac{r_{i}}{d}\)
9 End For
10 Output: Point-Cloud, PC = \(\{P_{ei}\mid i=1,...,n\}\)
```  
**Algorithm 1** Point-cloud Creation Algorithm  
The description of the algorithm is as followed. The algorithm consists of four steps: Step 1 is the input step. Step 2 is the calculation step. Step 3 is the iteration step. Step 4 is the output step. In the input step, the following entities are defined: Center Point \(P_{c}=(P_{cx},P_{cy})\in\Re^{2}\), Length \(d>0\), Initial Angle \(\alpha\in\Re\), Instantaneous Distances (\(r_{i}\in\Re\)\(\mid\)\(i=1,...,n\)), and Rotational Angles (\(\rho_{i}\in\Re\)\(\mid\)\(i=1,...,n\)). In the calculation step, \(P_{0}=(P_{0x},P_{0y})\) is calculated, which is a point at a distance \(d\) and the line \(P_{c}P_{0}\) makes an angle \(\alpha\) in the counter-clockwise direction from the \(x\)-axis. In the iteration step, the points denoted as \(P_{i}=(P_{ix},P_{iy})\) are created by rotating \(P_{0}\) at an angle \(\rho_{i}\) in the counter-clockwise direction from the \(x\)-axis. Afterward, the points \(P_{i}=(P_{ix},P_{iy})\) are placed at a distance \(r_{i}\) from \(P_{c}\) resulting \(P_{ei}=(P_{ix},P_{iy})\), \(i=1,...,n\). In the output step, the points \(P_{ei}=(P_{ix},P_{iy})\), \(i=1,...,n\), are collected for creating the desired Point-Cloud, i.e., PC = \(\{P_{ei}\mid i=1,...,n\}\). Figure 6 schematically illustrates the algorithm up to two iterations. As seen from Figure 6, the algorithm creates points with respect to \(P_{c}\) and \(P_{0}\) depending on the values of \(r_{i}\) and \(\rho_{i}\). It can be used to create different kinds of planner shape. In this respect, the user needs to choose the right pairs of Instantaneous Distances (\(r_{i}\in\Re\)\(\mid\)\(i=1,...,n\)) and Rotational Angles (\(\rho_{i}\in\Re\)\(\mid\)\(i=1,...,n\)). To get more insights into the algorithm, three example shapes are created as shown in Figure 7. In particular, the point-clouds shown in Figure 7 correspond to a circle, a curvy shape, and a leaf. As seen in Figure 7a for \(\alpha=5^{\circ}\), \(r_{i}=20\), \(i=1,...,37\), \(\rho_{1}=0\), \(\rho_{2}=10\),..., \(\rho_{37}=360\) degrees, the points of the point-clouds correspond to the points on the circumference of a circle having a radius of 20 and the center at (5, 10). By linearly decreasing \(r_{i}\) and simultaneously increasing \(\rho_{i}\) and vice versa creates the point-cloud of a curvy shape as shown in Figure 7b.