IPPJ-Computer Screen and Coordinate Grid Lesson
Computer Screen and Coordinate Grid
The computer's operating system organizes the display screen of a computer monitor into a grid of x and y coordinates, like a checkerboard. Each square on the screen is called a "pixel", which means picture element. When the computer wants to display something on the screen it sends out the coordinates of the square in the grid and the color of the pixel element. The coordinate system has the origin (0, 0) at the top left corner of the screen.
The x increases going to the right and the y increases going down. There are no negative numbers.
Processing uses a Cartesian coordinate system with the origin in the upper-left corner. If your sketch is 640 pixels wide and 480 pixels high, coordinate (0, 0) is the upper-left pixel, and coordinate (640, 480) is in the lower-right. The last visible pixel in the lower-right corner of the screen is at position (639,479) because pixels are drawn to the right and below the coordinate.
Notice that the coordinate system for pixels in a computer window starts at the top left with (0, 0) and moves the X to the right in a positive direction and y down vertically in a positive direction. You can create your own grid using graph paper or a spreadsheet program.
[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION