Representation of contours by connected quadratic curves and its implementation and simulation