The distance between any two points on the x y plane (a,b) and (c,d) has one of two formulas. or if you use c-a you have to also use d-b, and the other way around for a-c and b-d. You can rearrange which order you add though. So with (-1,5) and (3,3) here is the math
You could simplify this to
Let me know if there was anything you didn't understand.