The following describes the mathematics for the so called Bézier curve. It is attributed and named after a French engineer, Pierre Bézier, who used them for the body design of the Renault car in the 1970's. They have since obtained dominance in the typesetting industry and in particular with the Adobe Postscript and font products.

Consider N+1 control points pk (k=0 to N) in 3 space. The Bézier parametric curve function is of the form

B(u) is a continuous function in 3 space defining the curve with N discrete control points Pk. u=0 at the first control point (k=0) and u=1 at the last control point (k=N).

#include <graphics.h>  
#include <iostream.h>  
struct point  
  int x,y;  

void main()  
  int gd=DETECT,gm=VGAHI;  
  cout<<"Enter control points ";  
  p=new point[4];  
  for (int i=0;i<4;i++)  
    cout<<"Enter point P"<<i<<"(x,y)";  
  for (float u=0;u<=1;u+=.001)  
    float x,y;