Re: Line intersection point is wrong

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Line intersection point is wrong
Дата
Msg-id 3949.1466459910@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Line intersection point is wrong  (Emre Hasegeli <emre@hasegeli.com>)
Ответы Re: Line intersection point is wrong  (Emre Hasegeli <emre@hasegeli.com>)
Список pgsql-bugs
Emre Hasegeli <emre@hasegeli.com> writes:
>> After working out the algebra by hand, I think the attached is correct
>> (and it does pass the regression tests, yay).  I also made the
>> line_parallel and line_perp tests more symmetric and zero-divide-free.

> It looks better to me, though not completely symmetric:

> hasegeli=# select '{0.000001,1000,0}'::line ?|| '{0.00009,90000,0}'::line;
>  ?column?
> ----------
>  f
> (1 row)

> hasegeli=# select '{0.00009,90000,0}'::line ?|| '{0.000001,1000,0}'::line;
>  ?column?
> ----------
>  t
> (1 row)

Hmm, that's annoying, although of course the existing code has problems
of the same ilk:

regression=# select '{1000,0.000001,0}'::line ?|| '{90000,0.00009,0}'::line;
 ?column?
----------
 f
(1 row)

regression=# select '{90000,0.00009,0}'::line ?|| '{1000,0.000001,0}'::line;
 ?column?
----------
 t
(1 row)

Basically this comes down to the fuzziness of the FPzero/FPeq tests.

It might be possible to fix this particular problem by changing the FPzero
tests in line_parallel() to exact "== 0" tests; though we would likely
be well advised to still keep the main test as FPeq.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Emre Hasegeli
Дата:
Сообщение: Re: Line intersection point is wrong
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #14204: COMPATIBILITY