line()

Shape / 2D Primitives

Description

Draws a line between two points. Supports both 2D and 3D.

Syntax

void line(float x1, float y1, float x2, float y2) void line(float x1, float y1, float z1, float x2, float y2, float z2)

Parameters

NameTypeDescription
x1floatx-coordinate of the first point
y1floaty-coordinate of the first point
x2floatx-coordinate of the second point
y2floaty-coordinate of the second point
z1/z2floatz-coordinates (3D only, optional)

Returns

void

Related

Under the Hood

Implementation in Processing.h / Processing.cpp:

Loading...