python implementation 1d, xy coordinate step 1