I guess it's an error into the line you copied into this post, but it should be sprite.Y
Also, the 0,0 coordinate you give first is the top left corner of the layout. Not sure why you want to measure the distance between this point of the screen and a Sprite that possibly is your ship.
Perhaps instead of the 0's you should put the planet coordinates.
Try posting your capx, or a capx that reproduce the issue, detailing more precisely what you'd expect.
Check also the how do I FAQ there is at least one element listed treating about gravitation, possibly it could help.