Improving the sensitivity of projectCoordsToCurve() and using minimization instead of root finding.