📅  最后修改于: 2022-03-11 14:58:42.897000             🧑  作者: Mango
public void setLocation(Location location)
{
GeomagneticField geomagneticField = new GeomagneticField(
(float) location.getLatitude(),
(float) location.getLongitude(),
(float) location.getAltitude(),
System.currentTimeMillis());
declination = (float) Math.toRadians(geomagneticField.getDeclination());
}
}