Tail length and proximity to celestial bodies