If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

line(x1, y1, x2, y2)

Draws a line from one point to another. The color of the line is determined by the most recent stroke() call. The thickness of the line is determined by the most recent strokeWeight() call. The line ending style can be changed using strokeCap().
Parameters:
NameDescription
x1the x-coordinate of the first point
y1the y-coordinate of the first point
x2the x-coordinate of the second point
y2the y-coordinate of the second point

Want to join the conversation?

No posts yet.