I have 2 points (Android Location objects): current location and target location. Also I have a direction (in degrees) of my device.
I wanna calculate an angle between target location and direction. How to do it properly?
I receiving location from FusedLocationProvider (if it's matter). Now i just use
float requiredAngle = Math.abs(location.getBearing() - 180 - target.bearingTo(location));
float angleBetween = Math.abs(requiredAngle - location.getBearing());
and it's returns incorrect angle.
I think I should caclate the difference between true north and magnetic north and add device direction. Then use currentPosition.bearingTo(target), and subtract device direction from bearing.
