void bezier(Vec2d a,Vec2d b, Vec2d c,Vec2d d){
float points = 1000;
for (float p = 0; p < 1.0 ; p=(p+(1.0/points))){
Vec2d e=((a * pow(1.0-p,3.0 ))+ (b * 3.0 * pow(1.0-p,2.0)*p) +(c * 3.0 * pow(p,2.0)*(1.0-p)) + (d * pow(p,3.0)));
glVertex2f(e.x, e.y);
}
//A*b*b*b + B*3*b*b*p + C*3*b*p*p + D*p*p*p
}
glColor3f( 1,1,1 );//sets color can add a alpha on end 255,255,255,255
//glRectf( mouseX-rectSize, mouseY-rectSize, mouseX+rectSize, mouseY+rectSize); //two arguments cords of perp corners this case based on mouse
Vec2d a(100,400);
Vec2d b(200,800);
Vec2d c(300,0);
Vec2d d(400,400);
glPointSize(10.0);
glBegin(GL_LINE_STRIP);
bezier( a, b, c,d);
glEnd();