|Step 1a: Draw a line between two
The slope of the line is
m = dy/dx = (y1-y2)/(x1-x2)
|Step 1b: Draw a tangent line at one
If you're adding a point to itself, you don't have two points to take a finite difference, so you take the infinitesimal slope dy/dx.
For the P-256 curve above, y^2 = x^3 - 3 x + b, the total derivative is:
2 y dy = 3 x^2 dx - 3 dx
Which rearranges to:
m = dy/dx = (3 x ^2 - 3) / (2 y)
The BitCoin secp256k1 is the same, without the "-3".