FitLineToPoints_TheilSen
Approximates points with a line using TheilSen algorithm, optionally with Siegel's improvement.
Applications:Finds a well matching line, ignoring up to 29.3% (TheilSen) or 50.0% (Siegel) outliers. Outliers do have some influence on accuracy.
Syntax
C++
C#
Python
def FitLineToPoints_TheilSen( inPoints: list[Point2D], /, *, inRange: Range | None = None, inVariant: TheilSenVariant = TheilSenVariant.TheilSen, inSampleLimit: int | None = None, inOutlierRatio: float | None = None ) -> ( outLine: Line2D, diagOrientations: list[float] )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inPoints | list[Point2D] | Input points | ||
![]() |
inRange | Range | None | None | Determines which array points take part in fitting process | |
![]() |
inVariant | TheilSenVariant | TheilSenVariant.TheilSen | Switches between Theil-Sen and Siegel methods | |
![]() |
inSampleLimit | int | None | 5 - ![]() |
None | How many pairs of points are used to estimate orientation |
![]() |
inOutlierRatio | float | None | 0.0 - 0.99 | None | |
![]() |
outLine | Line2D | Fitted line | ||
![]() |
diagOrientations | list[float] | Sample orientations used to determine the output line orientation |




