3
$\begingroup$

If I have two points at different X/Y coordinates, I know that:

  • They are vertically aligned if both are at the same X coordinate;
  • They are horizontally aligned if both are at the same Y coordinate.

Based on the X/Y coordinates of one in relation to the other I can also tell the distance between them, etc.

Now, how can you tell that the points are diagonally aligned by following the same logic?

$\endgroup$
  • $\begingroup$ Do you mean that the line between them is at a 45 degree angle to horizontal? $\endgroup$ – turkeyhundt Mar 17 '15 at 22:01
  • $\begingroup$ Yes, exactly... $\endgroup$ – Fernando Aires Castello Mar 17 '15 at 22:05
6
$\begingroup$

If you mean that the line between the two points is at a 45 degree angle to the horizontal (or that the two points would be opposite vertices of a square), then you need to look at the difference between the two X values and the difference between the two Y values. If those differences are the same, then you have achieved what you are looking for.

$$|x_1-x_2|=|y_1-y_2|$$

$\endgroup$
2
$\begingroup$

If they are diagonally aligned in one direction, the difference in coordinates will be the same. So $(1,5)$ and $(9,13)$ are on a diagonal because $5-1=13-9$ Can you do the other diagonal? Hint: two point form for a line

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.