Implement Kaitlyn's distance-measuring math