1
$\begingroup$

Given a rectangle with X, Y (Integers) as the top left vertex. Assuming that the rectangle is axis parallel and height and width cannot be negative what can be said about the bottom right vertex of the rectangle? Consider that top left is considered as origin as in many computer applications.

I am raising this point because if there are 2 rectangles then according to the origin the intersection point(top left vertex) may change.

$\endgroup$
  • 1
    $\begingroup$ If the real question is "what can be said" with only partial (or probabilistic) info of the width and height, then you should specify what info you have. $\endgroup$ – Lee David Chung Lin Jan 28 at 3:18
1
$\begingroup$

It is true that in some applications of computer science, the upper left corner is considered as the origin of coordinates. For example, digital images assume that system.

In those cases, the x coordinate of the bottom right corner is equal to the width of the image:

$$ x_{br} = w $$

And the y coordinate is equal to the minus height:

$$ y_{br} = -h $$

Therefore, if the top left corner was not found at the origin, but at the coordinates $ \left(x_{tl};y_{tl}\right) $ given, the coordinates of the bottom right corner result:

$$ x_{br} = x_{tl} + w \\ y_{br} = y_{tl} - h $$

$\endgroup$
  • $\begingroup$ With upper left corner as origin the values usually increase to the right and down, so you would add the height. $\endgroup$ – Daniel Mathias Jan 28 at 3:41
  • 1
    $\begingroup$ I assume for my answer that the y coordinates are considered increasing upwards. In the georeferencing of images, a negative image height is used (and added) to solve that particularity, but the question explicitly clarifies that the height should be considered positive. $\endgroup$ – Gabriel De Luca Jan 28 at 3:50

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.