compute coordinates on curve