In my app i want to calculate the angle of the specific location(lat and longs are given) from the north.is there any way to calculate this.Actually i have find put the direction of the phone but i want to get angle of location from north.here is my code.please suggest any related solution.Thankx
myAzimuth=Math.round(event.values[0]);
myPitch=Math.round(event.values[1]);
myRoll=Math.round(event.values[2]);
Toast.makeText(this, "Value"+myAzimuth, Toast.LENGTH_SHORT).show();
if(myAzimuth<22){
Toast.makeText(this, "North Direction", Toast.LENGTH_SHORT).show();
}
else if (myAzimuth >= 22 && myAzimuth < 67)
Toast.makeText(this, "North East", Toast.LENGTH_SHORT).show();
else if (myAzimuth >= 67 && myAzimuth < 112)
Toast.makeText(this, "East Direction", Toast.LENGTH_SHORT).show();
else if (myAzimuth >= 112 && myAzimuth < 157)
Toast.makeText(this, "South east Direction", Toast.LENGTH_SHORT).show();
else if (myAzimuth >= 157 && myAzimuth < 202)
Toast.makeText(this, "South Direction", Toast.LENGTH_SHORT).show();
else if (myAzimuth >= 202 && myAzimuth < 247)
Toast.makeText(this, "South west Direction", Toast.LENGTH_SHORT).show();
else if (myAzimuth >= 247 && myAzimuth < 292)
Toast.makeText(this, "west Direction", Toast.LENGTH_SHORT).show();
else if (myAzimuth >= 292 && myAzimuth < 337)
Toast.makeText(this, "North west Direction", Toast.LENGTH_SHORT).show();
else if (myAzimuth >= 337)
Toast.makeText(this, "North Direction", Toast.LENGTH_SHORT).show();