Co ordinates - Griffith-ICT/1701ICT-Creative-Coding GitHub Wiki
When we want to display anything on a computer we need to indicate the position where the object will be drawn.
The position is specified in co-ordinates: x and y.
The x co-ordinate indicates how many pixels across the screen from the left.
The y co-ordinate indicates how many pixels down the screen from the top.
Let's have a look at the ellipse example:
ellipse(56, 46, 55, 55);
The first parameter is the x co-ordinate, therefore the ellipse will be drawn 56 pixels to the right of the left edge of the canvas (we can see the left edge of the canvas if it has a background colour).
The second parameter is the y co-ordinate, the ellipse will be drawn 46 pixels down from the top edge of the canvas.
The next two parameters are the width and the height. Therefore the right side of the ellipse will be 55 pixels to the right of the left edge of the ellipse. The bottom side of the ellipse will be 55 pixels down from the top of the ellipse.
