Cosine is

which applies to a right triangle. I hope that helps you.
If the points are scattered it’s no correlation
After the translation performed J is now (-2,-2), M is now (-1,-4), K is now (4,1), and L is now (5,-1).
Hope this helps!
The solution is sometimes integers