color lc = color(0, 0, 0); color pc = color(255, 0, 0); float pr = 6.0; // draw the list of points in array c connected with lines void drawCurve(ArrayList c, boolean withPoints) { PVector p0, p1; p0 = (PVector) c.get(0); if (withPoints) { stroke(pc); ellipse(p0.x, p0.y, pr, pr); } for(int i=1; i < c.size(); i++) { p1 = (PVector) c.get(i); stroke(lc); line(p0.x, p0.y, p1.x, p1.y); if (withPoints) { stroke(pc); ellipse(p1.x, p1.y, pr, pr); } p0 = p1; } }