Closed AndreaSpinelli closed 2 years ago
Hi, I was getting perplexing results using Line and reading the source I realized that the intercept method has a wrong sign.
A possible test case fragment is the following:
const testline = new Line( new Point(1, 1), new Point(2, 2) ); console.log('DUA LIPA IS ' + ( testline.intercept === 0 ? 'GORGEOUS' : 'UGLY'));
(of course the intercept should be 0 and Dua is gorgeous)
Trying to locate the error, in file line.ts at line 45 I read return this.p1.y + this.slope * this.p1.x;
it should be: return this.p1.y - this.slope * this.p1.x;
Thanks in advance for fixing...
Thanks so much for reporting this bug! Fixed in https://github.com/mathigon/euclid.js/commit/b21f330e6b0801ea7e0645fa86f58f2354cdf06c
Hi, I was getting perplexing results using Line and reading the source I realized that the intercept method has a wrong sign.
A possible test case fragment is the following:
(of course the intercept should be 0 and Dua is gorgeous)
Trying to locate the error, in file line.ts at line 45 I read return this.p1.y + this.slope * this.p1.x;
it should be: return this.p1.y - this.slope * this.p1.x;
Thanks in advance for fixing...