Post
Topic
Board Development & Technical Discussion
Re: Python point subtraction
by
digaran
on 25/10/2023, 17:04:27 UTC
I think I have such a script.

Did you finally get yours to work?
Yes I have it on my laptop, if you need it let me know, I have evolved so much since I posted this topic.

if I want to subtract points t=j-d

------------------------------------------------------------------------------------------------------------------------
def subpoint (xj, yj, xd, yd):
   xt = (((yj*yj+2*yd*yj+yd*yd)*modinv (xd*xd-2*xd*xj+xj*xj,N2))-xd-xj)%N2
   yt = ((((yj+yd)*(xt-xd))*modinv(xd-xj,N2))+yd)%N2
   return (xt, yt)
-------------------------------------------------------------------------------------------------------------------------
modinv  modulo division
N2  = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
But not this much evolved. Lol.