Updated to handle circular coordinate.