2 Answers
2

So from the compass you have bearings that are the limits of visibility. In your figure they appear to be $k+20^{\circ}$ and $k-20^{\circ}$ Then take the difference in position between the phone and each point. You can feed this to the Atan2 function to get the bearing (remember to convert between degrees and radians). If it is in range, you are good.

you mean, to take the distance between the phone and each point? Thanks
–
saimonxFeb 14 '11 at 22:05

Yes, take the distance north/south (x)and the distance east/west (y). Then the bearing to the point is Atan2(y,x) (if zero is north) Subtract this from the angle the phone is pointing and if it is within 20 degrees of zero you can see it.
–
Ross MillikanFeb 14 '11 at 22:49

You should edit your original post instead of posting this as an answer, please.
–
RaskolnikovFeb 15 '11 at 16:11

we're sorry, but as a spam prevention mechanism, new users aren't allowed to post images. Earn more than 10 reputation to post images.
–
saimonxFeb 15 '11 at 16:24

Atan2 is giving results in radians, not degrees, so you need to multiply by $180/\pi$. This gives the bearing from P1 to P2 as about 75 deg, which seems about right given that it is mostly north and a bit east. You also have a potential loss of precision problem when you subtract the coordinates as they are within .001 of each other it is only the numbers below that which contribute.
–
Ross MillikanFeb 15 '11 at 16:55

155-75=80, 80 it's outside the angle view, right? But this is not possible, the P2 is inside the angle view. What calculation am i doing wrong? Thanks!!
–
saimonxFeb 15 '11 at 21:59