xxxxxxxxxx
function setup() {
createCanvas(600, 600);
angleMode(DEGREES);
}
function draw() {
background(220);
// translate to the center and scale up to make
// a small coordinate system
translate(width/2, height/2);
scale(50);
strokeWeight(.05);
// Draw the x and y axis, along with little arrows at the end of each line
line(-5, 0, 5, 0);
line(0, -5, 0, 5);
// x-axis right side
line(5, 0, 4.75, 0.25);
line(5, 0, 4.75, -0.25);
// x-axis left side
line(-5, 0, -4.75, 0.25);
line(-5, 0, -4.75, -0.25);
// y-axis bottom
line(0, 5, 0.25, 4.75);
line(0, 5, -0.25, 4.75);
// y-axis top
line(0, -5, 0.25, -4.75);
line(0, -5, -0.25, -4.75);
}