Python cartesian to length coordinate system complete