In directx or opengl programming and most low level languages, A rect command is given 4 coordinates to fix the position of the rectangle, (not introducing the z element, as thats usualy used in placement)
So for example rect 200 248 240 22 would be:
top left corner is x:200 y:248
bottom right corner is x:240 y:22
this would then give shape to the entire rectangle
(usually in a graphic engine this would be followed with more variables to alpha, shading, etc..)