From 3f06074bfdf720c77bf3c3678f12a1c2ee4d1c9a Mon Sep 17 00:00:00 2001 From: feltroidprime Date: Mon, 17 Jun 2024 13:35:45 +0200 Subject: [PATCH] Merge commit 'dac43112e3298cf64cc8eb656dff05f1d4072ec6' --- tools/ecip/main.sage | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ecip/main.sage b/tools/ecip/main.sage index ddf92dfb..6a89d348 100644 --- a/tools/ecip/main.sage +++ b/tools/ecip/main.sage @@ -34,16 +34,16 @@ def init(_p, _r, _h, _A, _B): def line(P, Q): # [a, b, c] = Matrix([P, Q, -(P + Q)]).transpose().kernel().basis()[0] # return a * x + b * y + c - if P == 0 and Q == 0: - return 1 + if P == 0: + return 1 if Q == 0 else x - Q.xy()[0] + if Q == 0: + return x - P.xy()[0] px, py = P.xy() - if P == Q: m = (3 * px**2 + A) / (2 * py) b = py - m * px return -m * x + y - b - if P == -Q: return x - px