Algorithms for rational Bézier curves