Change coordinates to two points