Code example for GeomagneticField

Methods: getDeclination

0
	public long getAge() { 
		return System.currentTimeMillis() - lastTime;
	} 
	 
	public float getDeclination() { 
		GeomagneticField field = new GeomagneticField(
				(float) currentLocation.getLatitude(),
				(float) currentLocation.getLongitude(),
				(float) currentLocation.getAltitude(),
				currentLocation.getTime());
		return field.getDeclination();
	} 
	 
	synchronized public Difference getDifference(TargetLocation target) {
		double adjacent = currentLocation.distanceTo(target) * Util.FEET_INA_METER;
		double opposite = target.getAltitude() * Util.FEET_INA_METER;
		double hypotenuse = Math.sqrt(opposite*opposite + adjacent*adjacent);
		float azimuth = (currentLocation.bearingTo(target) + 360) % 360;
		double altitude = Math.atan(opposite / adjacent) * 57.2957795;
		float speed = target.getSpeed() * Util.MPH_INA_MPS; 
Contextual code suggestions in your IDE  Get Codota for Java