oh well, ill try:
first thing you need to do, is to solve (a+b)***711;(n-1) wile n is the number of control points, so if you want 3 control points then you get:
a***711;2+2*a*b+b***711;2 ,if 5 then:
a***711;4 + 4*a***711;3*b + 6*a***711;2*b***711;2 + 4*b***711;3*a + b***711;4
now you got to multiply each.. err... step, or whatever its called with coordinate of each control point, so with 3 control points you get:
where (x1,y1),(x2,y2) and (x3,y3) are control points of the line
only yhing you have to do now is:
thats how the bezier curves work in 2d for avs, for patch is little more complicated, and i really think i do not have skill to explain this one, so ill just post a preset.
preset is done in time we didnt have loops and megabuffers, so you can make it with much less code, its 5x5 point bezier patch, UCD had 4x4 one allready, so thought to do the 5x5...
as a hint i can say, think about this line of code:
p6=p1*sqr(1-hy)*sqr(1-hy) + p2*4*sqr(1-hy)*(1-hy)*hy + p3*6*sqr(1-hy)*sqr(hy) + p4*4*sqr(hy)*hy*(1-hy) + p5*sqr(hy)*sqr(hy);
[edit: Stretch fix