Multiple answers, depending what you need to do. Here are some.
For 2D graphs you can use the path function. You can't find it by searching for Bezier because the scripting index spells it Bézier. Try searching for zier instead. @XanGregg @sheila_loring
This example extends the scripting index example with dragable handles.
// initial data; points 3 and 5 are not initially constrained about point 4
points = [
10 10 1,// move-to
30 70 0,// control point
40 10 0,// control point
50 40 3,// bezier
60 60 0,// control point
70 20 0,// control point
90 10 3 // bezier
];
// moving a square handle will call this function to
// copy the handle coordinates to the matrix
setpoint = Function( {index, x, y}, // parameters
{angle, distance}, // local variables
// copy to the matrix
points[index, 1] = x;
points[index, 2] = y;
// 3 and 5 are constrained about 4, comment out to see why...
// if the angles don't match, it isn't smooth
If( index == 3 | index == 5,
other = If( index == 3, 5, 3 ); // if I'm 3, he must be 5, etc
// trig in radians, 2*pi is 360
// atan does all 4 quadrants with 2 arguments
angle = ATan( points[index, 2] - points[4, 2], points[index, 1] - points[4, 1] );
// maintain other's distance
distance = Sqrt( (points[other, 2] - points[4, 2]) ^ 2 + (points[other, 1] - points[4, 1]) ^ 2 );
// fix other's angle to match my angle, but opposite me
points[other, 1] = points[4, 1] + distance * Cos( angle + Pi() );
points[other, 2] = points[4, 2] + distance * Sin( angle + Pi() );
);
// redraw
gb << inval;
);
New Window( "Example",
gb = Graph Box(
Fill Color( "blue" );
// there is no good shortcut for creating handles; the JSL holds the instances
Handle( points[1, 1], points[1, 2], setpoint( 1, x, y ) );
Handle( points[2, 1], points[2, 2], setpoint( 2, x, y ) );
Handle( points[3, 1], points[3, 2], setpoint( 3, x, y ) );
Handle( points[4, 1], points[4, 2], setpoint( 4, x, y ) );
Handle( points[5, 1], points[5, 2], setpoint( 5, x, y ) );
Handle( points[6, 1], points[6, 2], setpoint( 6, x, y ) );
Handle( points[7, 1], points[7, 2], setpoint( 7, x, y ) );
// construction lines
Pen Color( "red" );
Line( {points[1, 1], points[1, 2]}, {points[2, 1], points[2, 2]} );
Line( {points[3, 1], points[3, 2]}, {points[4, 1], points[4, 2]} );
Line( {points[4, 1], points[4, 2]}, {points[5, 1], points[5, 2]} );
Line( {points[6, 1], points[6, 2]}, {points[7, 1], points[7, 2]} );
// the bezier
Pen Color( "black" );
Path( points );
)
);
I realized I should also constrain moving point 4 to drag points 3 and 5 along as well. (Not done, should be easy.)
Bezier control points
Maybe you need a spline. I'm not sure what the distinction between spline, p-spline, b-spline in the scripting index is. I used spline HeatColor vs Spline vs Interpolate to make this curve
spline coef, spline eval
There is also support for Bezier splines in JMP's 3D OpenGL support: https://www.jmp.com/support/help/14-2/bezier-curves.shtml which might help draw a surface. A poor example is hidden in FFT Video
Great post @Duane_Hayes Understanding cubic splines
Something I ran into along the way: https://www.tinaja.com/glib/bezconn.pdf
Craige