### Question:
SphericalUtil { public static LatLng computeOffset(LatLng from, double distance, double heading) { distance /= EARTH_RADIUS; heading = toRadians(heading); double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double cosDistance = cos(distance); double sinDistance = sin(distance); double sinFromLat = sin(fromLat); double cosFromLat = cos(fromLat); double sinLat = cosDistance * sinFromLat + sinDistance * cosFromLat * cos(heading); double dLng = atan2( sinDistance * cosFromLat * sin(heading), cosDistance - sinFromLat * sinLat); return new LatLng(toDegrees(asin(sinLat)), toDegrees(fromLng + dLng)); } private  SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng from, double distance, double heading); static LatLng computeOffsetOrigin(LatLng to, double distance, double heading); static LatLng interpolate(LatLng from, LatLng to, double fraction); static double computeDistanceBetween(LatLng from, LatLng to); static double computeLength(List<LatLng> path); static double computeArea(List<LatLng> path); static double computeSignedArea(List<LatLng> path);  }### Answer:
@Test public void testComputeOffset() { expectLatLngApproxEquals(front, SphericalUtil.computeOffset(front, 0, 0)); expectLatLngApproxEquals( up, SphericalUtil.computeOffset(front, Math.PI * EARTH_RADIUS / 2, 0)); expectLatLngApproxEquals( down, SphericalUtil.computeOffset(front, Math.PI * EARTH_RADIUS / 2, 180)); expectLatLngApproxEquals( left, SphericalUtil.computeOffset(front, Math.PI * EARTH_RADIUS / 2, -90)); expectLatLngApproxEquals( right, SphericalUtil.computeOffset(front, Math.PI * EARTH_RADIUS / 2, 90)); expectLatLngApproxEquals( back, SphericalUtil.computeOffset(front, Math.PI * EARTH_RADIUS, 0)); expectLatLngApproxEquals( back, SphericalUtil.computeOffset(front, Math.PI * EARTH_RADIUS, 90)); expectLatLngApproxEquals(left, SphericalUtil.computeOffset(left, 0, 0)); expectLatLngApproxEquals( up, SphericalUtil.computeOffset(left, Math.PI * EARTH_RADIUS / 2, 0)); expectLatLngApproxEquals( down, SphericalUtil.computeOffset(left, Math.PI * EARTH_RADIUS / 2, 180)); expectLatLngApproxEquals( front, SphericalUtil.computeOffset(left, Math.PI * EARTH_RADIUS / 2, 90)); expectLatLngApproxEquals( back, SphericalUtil.computeOffset(left, Math.PI * EARTH_RADIUS / 2, -90)); expectLatLngApproxEquals( right, SphericalUtil.computeOffset(left, Math.PI * EARTH_RADIUS, 0)); expectLatLngApproxEquals( right, SphericalUtil.computeOffset(left, Math.PI * EARTH_RADIUS, 90)); }