2D Curve algorithms