Name

line()

Examples
line(30, 20, 85, 75)
line(30, 20, 85, 20)
stroke(126)
line(85, 20, 85, 75)
stroke(255)
line(85, 75, 30, 75)
# Drawing lines in 3D requires P3D
# as a parameter to size()
size(100, 100, P3D)
line(30, 20, 0, 85, 20, 15)
stroke(126)
line(85, 20, 15, 85, 75, 0)
stroke(255)
line(85, 75, 0, 30, 75, -50)
Description
Syntax
line(x1, y1, x2, y2)
line(x1, y1, z1, x2, y2, z2)
Parameters
x1
y1
x2
y2
z1
z2
Related strokeWeight()
strokeJoin()
strokeCap()
beginShape()
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License