implemented midpoint ellipse algorithm