how to get the corners of 2 points on a matrix

Solutions on MaxInterview for how to get the corners of 2 points on a matrix by the best coders in the world

showing results for - "how to get the corners of 2 points on a matrix"
Lorcan
21 Feb 2017
1say you have 2 points, (x1,y1) and (x2,y2)
2
3to get their corners, criss cross the x's and y's:
4
5corner1 = x1,y2
6corner2 = x2,y1
7
8if the original points are on the same x-axis or same y-axis,
9the criss cross result will give you back the original points
10
11