Cx = Ax - Bx and Cy = Ay - By
you have calculated A-B, not B-A
You can ask a new question or answer this question.