When calculating the distance from one point to the polynomial the mathematic says, that to terms have to be evaluated. As it turns out, for the first part, when the polynomial is of the first degree or the degree is zero, it evaluates to NaN, resulting in unpredictable behaviour in the code.
Luckily, as in the wiki described, we can almost safely remove this annoying part of the code without causing any errors.
When calculating the distance from one point to the polynomial the mathematic says, that to terms have to be evaluated. As it turns out, for the first part, when the polynomial is of the first degree or the degree is zero, it evaluates to NaN, resulting in unpredictable behaviour in the code. Luckily, as in the wiki described, we can almost safely remove this annoying part of the code without causing any errors.