def testDotProduct(self):
     self.assertAlmostEqual(dot(Vector(1.0, 0.0), Vector(0.0, 1.0)),
                            0.0, geom_places)
     self.assertAlmostEqual(dot(Vector(1.0, 1.0), Vector(-1.0, 1.0)),
                            0.0, geom_places)
     self.assertAlmostEqual(dot(Vector(2.0, 0.0), Vector(2.0, 0.0)),
                            4.0, geom_places)
     self.assertAlmostEqual(dot(Vector(1.0, 2.0), Vector(-1.0, 4.0)),
                            7.0, geom_places)
 def testDotProduct(self):
     self.assertAlmostEqual(dot(Vector(1.0, 0.0), Vector(0.0, 1.0)), 0.0,
                            geom_places)
     self.assertAlmostEqual(dot(Vector(1.0, 1.0), Vector(-1.0, 1.0)), 0.0,
                            geom_places)
     self.assertAlmostEqual(dot(Vector(2.0, 0.0), Vector(2.0, 0.0)), 4.0,
                            geom_places)
     self.assertAlmostEqual(dot(Vector(1.0, 2.0), Vector(-1.0, 4.0)), 7.0,
                            geom_places)
 def point_in_fov(self, p):
     if length(p - self.pos) > self.visibility_radius:
         return False
     d = p - self.pos
     ang = atan2(cross(self.real_dir, d), dot(self.real_dir, d))
     return -0.5 * self.visibility_fov < ang < 0.5 * self.visibility_fov