JayPi4c / Polynomial-Regression

MIT License
0 stars 0 forks source link

NaN in Distance Calculation #15

Open JayPi4c opened 4 years ago

JayPi4c commented 4 years ago

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.