-1
$\begingroup$

This is a practical question, so if you find something missing, please assume a real life scenario.

The question is related to GPS and the Earth.

lat1: my latitude, GPS position I'm standing at (degrees)
lon1: my longitude, GPS position I'm standing at (degrees)
dir1: my direction I'm facing (from north, 0-360°, positive clockwise)
lat2: latitude of object
lon2: longitude of object
view: my viewport

I'm a person with position lat1, lon1, facing dir1. My viewport is 180°. Object is located at lat2, lon2.

How do I calculate that object is within my viewport?

Edit: viewport is assumed to be 180° and has a 1km radius.

  • 1
    Do you assume that you can see over the horizon? Any limit to that?2011-07-24
  • 0
    I guess you could post your calculations, but before you do that, I'd check to make sure how well-posed your problem is. The way I see it, if you have a 180 degree view, but there is no limit to how far you can see, then you should be able to see any point on the globe, just by following a great circle route. So I would say the answer is that every object is in your viewport.2011-07-24
  • 0
    hmm that's a good point, actually, there's also a viewport radius which is 1km2011-07-24
  • 3
    @bizso09: Since you mention the frustrating waste of your time, you will probably be able to appreciate that the downvoters are frustrated about the waste of their time by scores of sloppily posed questions where one realizes after taking the time to read through them and think about them that the person who posed them didn't take the time and care to make sure all the relevant information is included. You've now further exacerbated that by forcing them to read through long comments before they get to an essential piece of information; you should edit that into the question.2011-07-24
  • 0
    @joriki long comments... your comment is especially short. What do you not understand about the question? Instead of writing a wall of text, you could have simply edited the question, too.2011-07-24
  • 1
    @bizso09: I don't know from which part of my comment you inferred that I don't understand the question. I wasn't criticizing long comments in general, but hiding crucial information about the question among long comments. I hadn't downvoted your question before, but I did now after your reaction. You still haven't added the viewport radius to the question after having noticed its omission and being alerted to the fact that it should be in the body of the question. Your chances of getting useful answers from the community will increase considerably if you show more respect to it.2011-07-24
  • 0
    @joriki instead of writing another wall of text, why don't you edit the question? This is a wiki. Giving out downvotes based on taking offense is very objective too...2011-07-24
  • 2
    @bizso09: It's fairly standard here to let people you don't know edit their own questions if they know how they should. Downvotes are a symbolic action designed to grade a user's effort and sincerity behind a post; joriki's action fulfilled that purpose faithfully. It's always the OP's responsibility to craft & improve any post - if he/she leaves it to the comment section they disservice readers. Taking the time to explain these things to newcomers is a separate affair. That said, I truly do understand the aggravation of lonely, grueling calculations - we've all been there. Live and learn bro.2011-07-24
  • 0
    @bizso09: I've removed my downvote. Thanks for clarifying the question.2011-07-24
  • 0
    This problem really begs for vector maths, if you can convert the positions and facing to 3D vectors there are some simple operations to determine this (and a lot of other good stuff).2011-07-24

2 Answers 2