Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Homework 5 rectangles coordinates

gabrimat (5630 points)
2 4 25
in HW5 optional by (5.6k points)
edited by
Hello everyone, looking in the txt files for homework 5 I got a doubt, probably interpreting them in the wrong manner. It says for each line you got two ordered pairs of the (x,y) coordinates of the bottom left and top right corner of the rectangle(poster). For example in the first line of rectangles_1.txt we got:

10 140  80 90

And I interpret it in this way:

coords of the bottom left (x:10,y:140)

coords of the top right (x:80,y:90)

I may now have sounded pretty absurd, but my interpretation is wrong for sure: how can the top right corner be lower than the bottom left (y2<y1) ? Maybe the order is x1,x2,y1,y2?

Thank you all for the attention.
185 views
closed

1 Answer

Best answer
GabrielAlexandru (7760 points)
2 4 29
by (7.8k points)
selected by
You are actually right. The top corner has a y coordinate lower than the bottom corner y because the origin of the system is not in the bottom left corner but in the top left. It's like having the bottom right quadrant of a Cartesian plane, where the absolute value of y increase as you go down.
gabrimat (5630 points)
2 4 25
by (5.6k points)
Now that all makes sense. I thought of everything as the first quadrant! Thank you.
GabrielAlexandru (7760 points)
2 4 29
by (7.8k points)
You are welcome!

Whenever you are working with images, or similar, in every programming languages you have to remember where the origin is and in most case it's in the top left corner.
gabrimat (5630 points)
2 4 25
by (5.6k points)
Yes, first time with me for images, used to think in the mathematical way so the default is the first quadrant.