The Geometry of Line-of-Sight and Weapons Fan Algorithms