Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // P + Q = R
- // (xp, yp) + (xq, yq) = (xr, yr)
- // Y = (yq - yp)/(xq - xp) (isn't that some kind of distance)?
- // xr = Y^2 - xp - xq
- // yr = Y(xp - xr) - yp
- // assert: neither P or Q are point at infinity, and Px != Qx
- // if P or Q is point at infinity, R = other point
- // if P = Q, double instead
- // if Px == Qx, set P to point at infinity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement