📜  磁偏角 android studio - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:42.897000             🧑  作者: Mango

代码示例1
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());
  }
}