line()
Shape / 2D PrimitivesDescription
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
| Name | Type | Description |
|---|---|---|
| x1 | float | x-coordinate of the first point |
| y1 | float | y-coordinate of the first point |
| x2 | float | x-coordinate of the second point |
| y2 | float | y-coordinate of the second point |
| z1/z2 | float | z-coordinates (3D only, optional) |
Returns
voidRelated
Under the Hood
Implementation in Processing.h / Processing.cpp:
Loading...