Advertisement
AnthonyCagliano

Untitled

Nov 28th, 2022
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. // P + Q = R
  2. // (xp, yp) + (xq, yq) = (xr, yr)
  3. // Y = (yq - yp)/(xq - xp) (isn't that some kind of distance)?
  4. // xr = Y^2 - xp - xq
  5. // yr = Y(xp - xr) - yp
  6. // assert: neither P or Q are point at infinity, and Px != Qx
  7. // if P or Q is point at infinity, R = other point
  8. // if P = Q, double instead
  9. // if Px == Qx, set P to point at infinity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement