Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEhIV-0004hK-TB for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Jun 2016 18:18:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bEhIV-0001Vv-Ff for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Jun 2016 18:18:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bEhHr-0000ox-Bx for pgsql-bugs@postgresql.org; Sun, 19 Jun 2016 18:17:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bEhHo-0006x5-RC for pgsql-bugs@postgresql.org; Sun, 19 Jun 2016 18:17:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u5JIHVul009954; Sun, 19 Jun 2016 14:17:31 -0400 From: Tom Lane To: emre@hasegeli.com cc: PostgreSQL Bugs Subject: Re: Line intersection point is wrong In-reply-to: References: <14750.1466353137@sss.pgh.pa.us> Comments: In-reply-to Emre Hasegeli message dated "Sun, 19 Jun 2016 20:02:34 +0200" Date: Sun, 19 Jun 2016 14:17:31 -0400 Message-ID: <9953.1466360251@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Emre Hasegeli writes: >> Hm. I don't think I believe the vertical-line cases there either. >> They seem to be assuming A = -1 in a vertical line, which would be >> true if the line was computed by line_construct_pts, but otherwise >> not necessarily. > I think we can just remove those cases. That would be nice. >> Also: your formulation of the general case assumes that >> (l1->A * l2->B - l2->A * l1->B) is not zero, which I'm >> not entirely convinced of. In principle the line_parallel test >> would catch the case, but seeing that that is not exactly how >> line_parallel computes its result, roundoff error could bite us >> here. I wonder if line_interpt_internal should skip the >> line_parallel call and instead do its own tests for zero divide >> to detect parallel lines. > If it would do its own test, the result would be inconsistent with ?# > and ?||. 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. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs