processingDrawing Basic Shapes


Introduction

In Processing, drawing shapes is key to the program. Otherwise, nothing would appear on the screen. This section will tell you how basic shapes are drawn.

Syntax

  • line(float x1, float y1, float x2, float y2)
  • line(float x1, float y1, float z1, float x2, float y2, float z2)
  • ellipse(float x, float y, float w, float h)
  • rect(float x, float y, float w, float h)
  • triangle(float x1, float y1, float x2, float y2, float x3, float y3)

Parameters

ParameterDetails
x1x-coordinate of the first point
y1y-coordinate of the first point
z1z-coordinate of the first point
x2x-coordinate of the second point
y2y-coordinate of the second point
z2z-coordinate of the second point
x3x-coordinate of the third point
y3y-coordinate of the third point
xx-coordinate
yy-coordinate
wwidth
hheight

Remarks

You can find a reference on Processing's foundation.

Processing homepage