BHoM / BHoM_Engine

Internal manipulation of the BHoM
GNU Lesser General Public License v3.0
26 stars 13 forks source link

Geometry_Engine: Edge case for FitLine with three equidistant points #3278

Closed peterjamesnugent closed 6 months ago

peterjamesnugent commented 6 months ago

Description:

With three equidistant points you can this line: https://github.com/BHoM/BHoM_Engine/blob/5b19bd49fcd5f09c2103c0ebf8074ce4ee0dd1ce/Geometry_Engine/Compute/FitLine.cs#L67

To produce NaN because you're dividing by 0, i.e. p2 = 0.

Steps to reproduce:

See test script.

Expected behaviour:

A line through the middle of all three points.

Test file(s):

#3278-FitLineEdgeCase