kmin function

Calculate min curvature