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

curve(x1, y1, x2, y2, x3, y3, x4, y4)

Draws a curved line on the screen. The first and second parameters specify the first anchor point and the last two parameters specify the second anchor. The middle parameters specify the points for defining the shape of the curve. Longer curves can be created by putting a series of curve() functions together. An additional function called curveTightness() provides control for the visual quality of the curve. The curve() function is an implementation of Catmull-Rom splines.
Parameters:
NameDescription
x1the x coordinate of first anchor point
y1the y coordinate of first anchor point
x2the x coordinate of first point
y2the y coordinate of first point
x3the x coordinate of second point
y3the y coordinate of second point
x4the x coordinate of second anchor point
y4the y coordinate of second anchor point

Want to join the conversation?

No posts yet.