pseudo-code:

1. create a vector from point A to B (just subtract their coordinates)
2. Get the angle from the positive X axis (or any axis you want, this is easiest because there's a built in...