How to find x2 and y2

advertisements

I have the following for a rectangle.. x1,y1,width and height

How can I find x2 and y2 having the values of above?


Draw (x1, y1) on a piece of paper with a coordinate system and then draw a rectangle of dimensions width x height on the same paper.

If you make width = 0, you can say that x1 = x2. If the widths gets any larger, then x2 > x1. You can say that x2 = x1 + width.

The height works the same way, so y2 = y1 + height.

I assumed that (x1, y1) is the bottom-left corner's coordinate.