0

I am doing an Android application. One part of my application is turn your smartphone around and let the camera shot focus on a gps location. Can anyone give me a hint about how to find the angle between smartphone camera shot orientation and a gps location?

Any help would be appreciated.

coder
  • 10,460
  • 17
  • 72
  • 125
Hao Fu
  • 1
  • 1
  • 1
    Your question doesn't really make sense. GPS only provides position data (i.e. longitude/latitude). Any rotation needs to be inferred through the phone's compass or your current direction of travel. – slugonamission Nov 14 '11 at 15:27
  • @slugonamission, I think that's what he actually wants... the current bearing. – Brad Nov 14 '11 at 15:35
  • I guess ur doing it the wrong way. What u really want is the location + which direction the user is facing. Let us know if thats right – the100rabh Nov 14 '11 at 15:35
  • In that case then, just read the value of the compass sensor. – slugonamission Nov 14 '11 at 15:35
  • GPS provides position data. and my application is letting my phone camera shot focus this GPS position, can anyone tell me how to do this or how to calculate the angle between camera shot and north. – Hao Fu Nov 14 '11 at 15:39
  • thanks,the location + which direction the user is facing: that whats do i want. – Hao Fu Nov 14 '11 at 15:44

1 Answers1

0

If I understood correctly, you are trying to determine the direction of the device.

This thread should help Rotating an ImageView like a compass (with the "north pole" set elsewhere)

Community
  • 1
  • 1
MrZander
  • 3,031
  • 1
  • 26
  • 50