quad()

Description
A quad is a quadrilateral, a four sided polygon. It is similar to a rectangle, but the angles between its edges are not constrained to ninety degrees. The first pair of parameters (x1,y1) sets the first vertex and the subsequent pairs should proceed clockwise or counter-clockwise around the defined shape.

Syntax


quad(x1, y1, x2, y2, x3, y3, x4, y4)


Parameters
x1 – x-coordinate of the first point
y1 – y-coordinate of the first point
x2 – x-coordinate of the second point
y2 – y-coordinate of the second point
x3 – x-coordinate of the third point
y3 – y-coordinate of the third point
x4 – x-coordinate of the fourth point
y4 – y-coordinate of the fourth point

Returns
none

Related
none

Bugs
The following code test keeps erasing when I try to draw a polygon:

void setup()
{
background(0,0,0);// set the screen black
stroke(255,0,0); //set color to red
}

void loop()
{
quad(10, 10, 4, 97, 112, 78, 103, 18);
}




Edit History