https://bbcdn.githack.com/rmsundaram/tryouts/raw/e06259fffad...
Devising the algorithm took around a month; did it in my free time. The implementation took a week, in HTML5 Canvas/JavaScript. Doing a 360°, not-bound-by-distance FoV would have been simpler, but FoV limited by both angle and distance took time.
The idea is to find the field of view of an observer on a map with blocking buildings (polygons) and also to service a line of sight query, to know if a given point is visible to the observer.
The code contains enough comments including citations and references to articles and books. Here's the actual repo from where the above page is served:
http://bitbucket.org/rmsundaram/tryouts/src/master/CG/WebGL/...