Function pointOnCurve