kotlin 경도 위도 계산 (1) 썸네일형 리스트형 [안드로이드 스튜디오 코틀린] 두 좌표 사이 거리 구하기 경도, 위도를 알 때 두 지점 사이의 거리를 구하는 공식을 적용시켜보자 우선 Object로 DistanceManager를 생성해서 아래의 코드를 추가해 준다. import java.math.RoundingMode import kotlin.math.* object DistanceManager { fun distance(preLat: Double?, preLng: Double?, postLat: Double?, postLng: Double?): String { if (preLat == null || preLng == null || postLat == null || postLng == null) { return "" } val result = (6371000 * acos( cos(compareRadians(p.. 이전 1 다음