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.