Coordinates of the ends of the right diagonal from a point in a grid

76 Views Asked by At

Suppose you have an n x n grid and an arbitrary point (x,y) on that grid.

figure 1

How could you write the coordinates of the two points (?,?) in figure 1 in terms of x, y, and n.