As other's have said, the essential point is the algebraic definition for additive inverses in elliptic arithemetic.
But if it helps, there are also some nice geometric illustrations like this one from Vitalik Buterin's Exploring Elliptic Curve Pairings:
Suppose R = (x,y). Since the elliptic curve is symmetric with respect to the x-axis, we ...
Here is the sample of code for subtraction of two points.
# -*- coding: utf-8 -*-
def OnCurve(x,y): # Check if the point is on the curve
A = (y*y)%P
B = (x*x*x)%P
C = False
if A == (B + 7):
C = True
def ECadd(xp,yp,xq,yq): # EC point addition
m = ((yq-yp) * modinv(xq-xp,P))%P
xr = (m*m-xp-xq)%P
yr = (m*(xp-...
You can negate a point (x, y) by simply changing it to (x, −y).
The document that defines ECDSA reminds us of this fact:
Here's a screenshot:
So once you have negated one of your points, just add it to the other one, and you have achieved subtraction.