Search processing.org:

Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name | ### curvePoint()
Examples |
    curve(5, 26, 5, 26, 73, 24, 73, 61);
    curve(5, 26, 73, 24, 73, 61, 15, 65);
    ellipseMode(CENTER);
    int steps = 6;
    for (int i = 0; i <= steps; i++) {
      float t = i / float(steps);
      float x = curvePoint(5, 5, 73, 73, t);
      float y = curvePoint(26, 26, 24, 61, t);
      ellipse(x, y, 5, 5);
      x = curvePoint(5, 73, 73, 15, t);
      y = curvePoint(26, 24, 61, 65, t);
      ellipse(x, y, 5, 5);
    }
Description | Evalutes the curve at point t for points a, b, c, d. The parameter t varies between 0 and 1, a and d are points on the curve, and b and c are the control points. This can be done once with the x coordinates and a second time with the y coordinates to get the location of a curve at t.
Syntax |
    curvePoint(a, b, c, d, t)
Parameters |
a | int or float: coordinate of first point on the curve
b | int or float: coordinate of second point on the curve
c | int or float: coordinate of third point on the curve
d | int or float: coordinate of fourth point on the curve
t | float: value between 0 and 1
Usage | Web & Application
Related | curve() curveVertex() bezierPoint()

Updated on November 22, 2008 08:39:25pm PST