triangle(x1, y1, x2, y2, x3, y3);
Draw a triangle on the screen.
Arguments
x1
The x position of the first pointy1
The y position of the first pointx2
The x position of the second pointy2
The y position of the second pointx3
The x position of the third pointy3
The y position of the third pointfunction setup()
createWindow(200, 200);
end
function draw()
background('purple');
triangle(50, 150, 100, 50, 150, 150);
end
Output