Re: [android-developers] Please help me with calculating direction from point A to B

2010-09-22 Thread Pedro Teixeira
I'm really not understanding how to go with this... I've been reading and reading.. I can find all kind of algorithms.. I can find a haversin algorithm that points me to the correct direction if my device is pointing north.. but the needle is static... so if i change the device orientation

Re: [android-developers] Please help me with calculating direction from point A to B

2010-09-22 Thread Christian Buchner
this sounds trivial to me. Just compensate the error that is introduced by not actually pointing the device north by subtracting that error from your arrow's pointing angle. No need to change any algorithm, just compensate for the dude, you're holding it wrong -- You received this message

Re: [android-developers] Please help me with calculating direction from point A to B

2010-09-22 Thread Pedro Teixeira
I've tried it. Adding and subtracting the value: event.values[0], which is actually my Azimuth in degrees returned by the sensor. But the orientation is off! .. The algorithm gives the Correct value, but it doesn't move because there's not sensor variables involved.. so if I subtract the

Re: [android-developers] Please help me with calculating direction from point A to B

2010-09-22 Thread Pedro Teixeira
Basicly, if my device is pointing the wrong direction. I can't see the value.. because the arrow is static. The arrow is always static if I don't use any of the sensor values. On Sep 22, 2010, at 10:08 AM, Christian Buchner wrote: this sounds trivial to me. Just compensate the error that

Re: [android-developers] Please help me with calculating direction from point A to B

2010-09-22 Thread Kostya Vasilyev
Pedro, I think you should learn something about the way direction (and orientation) is specified in computer programming. http://en.wikipedia.org/wiki/Yaw,_pitch,_and_roll http://en.wikipedia.org/wiki/Euler_angles

Re: [android-developers] Please help me with calculating direction from point A to B

2010-09-18 Thread Pedro Teixeira
Well.. I'm guessing it's to hard or impossible then.. :/ On Sep 17, 2010, at 9:56 PM, Pedro Teixeira wrote: Hi everyone... I'm back with the same issue for the last couple of days… I'm trying to create a compass for my application BUT the difference is that, instead of having a line always

Re: [android-developers] Please help me with calculating direction from point A to B

2010-09-18 Thread Kostya Vasilyev
Pedro, If I understand you correctly, you are having difficulties with the device's orientation. The bearing angle seems to be computed in the horizontal plane. If you wish to adjust for the device's orientation, you need to concatenate it with the bearing angle. Google for quaternions.

[android-developers] Please help me with calculating direction from point A to B

2010-09-17 Thread Pedro Teixeira
Hi everyone... I'm back with the same issue for the last couple of days… I'm trying to create a compass for my application BUT the difference is that, instead of having a line always pointing to north, I want this line to point for a specific point. I've been trying dozens of algorithms and