Re: Line intersection point is wrong
От | Tom Lane |
---|---|
Тема | Re: Line intersection point is wrong |
Дата | |
Msg-id | 18081.1466367402@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Line intersection point is wrong (Emre Hasegeli <emre@hasegeli.com>) |
Ответы |
Re: Line intersection point is wrong
|
Список | pgsql-bugs |
Emre Hasegeli <emre@hasegeli.com> writes: >> Hmm, well, what if we change line_parallel() so that what it tests >> is whether (l1->A * l2->B - l2->A * l1->B) is zero? That seems >> simpler and more symmetric than what it does now. > I was thinking to do so. I would also check for both sides not to > overflow, but that can wait. Patch attached. Unfortunately, > the change causes too much noise on the regression tests. I don't think this is right: + x = (l1->B * l2->C - l2->B * l1->C) / (l1->A * l2->B - l2->A * l1->B); + y = (l1->A * x + l1->C) / l1->B; You haven't done anything to exclude the possibility that l1->B is zero, so you could be getting zero-divide in the y calculation. FWIW, given that you're claiming the calculation is wrong as-is, there is no particularly good reason to assume that the expected results embedded in select_views.out are correct :-(. I doubt anyone's ever tried to verify those independently. regards, tom lane
В списке pgsql-bugs по дате отправления: