def distance_to(self, point, unit='<STR_LIT>'):
assert isinstance(point, GeoPoint), (<EOL>'<STR_LIT>'<EOL>)<EOL>if self == point:<EOL><INDENT>return <NUM_LIT:0.0><EOL><DEDENT>coefficient = <NUM_LIT><EOL>theta = self.longitude - point.longitude<EOL>unit = unit.lower() if unit else None<EOL>distance = math.degrees(math.acos(<EOL>math.sin(self.rad_latitude) * math.sin(point.rad_latitude) +<EOL>math.cos(self.rad_latitude) * math.cos(point.rad_latitude) *<EOL>math.cos(math.radians(theta))<EOL>)) * coefficient<EOL>if unit == '<STR_LIT>':<EOL><INDENT>return utils.mi_to_km(distance)<EOL><DEDENT>return distance<EOL>
Calculate distance in miles or kilometers between current and other
passed point.