#### Determining the Data Used to Construct the Line

The data used to construct the line is determined as follows:

- First a segment of the scan is determined using a starting point and an ending point within the scan. The starting and ending point are chosen as the point in the scan nearest [start_x, start_y, start_z] and the point nearest [end_x, end_y, end_z], respectively.

- Points are then discarded from the Start and End Points of the scan. The number of points discarded is discard_start and discard_end from the start and end, respectively. A line is then fitted to this set of points.

- Finally, the starting and ending points are added back in if they are within the tolerance defined. The line is then re-fitted once more to the new set of points.

The value of fit_type may be BF (Best Fit) or BFRE (Best Fit Recompensate). This determines whether a best fit or best fit with recompensation is done when calculating the line. For a description of Best Fit and Best Fit Recompensate, see "Constructing a Best Fit or Best Fit Recompensate Line"