How to compute hypotenuse and bearing
问题 I got the below code from @DanS at this link how-to-display-a-map-still-image-file-with-a-moving-current-location onCurrentPosition(Location current){ double hypotenuse = upperLeft.distanceTo(current); double bearing = upperLeft.bearingTo(current); double currentDistanceX = Math.cos(bearing) * hypotenuse; // "percentage to mark the position" double currentPixelX = (currentDistanceX / upperLeft.distanceTo(lowerRight) * Math.cos(upperLeft.bearingTo(lowerRight))) * mapWidth; moveIndicatorX