add ellipse algorithm to libgraph.cpp