From: adrianna Date: Fri, 16 Sep 2016 15:34:14 +0000 (+0200) Subject: corrected power usage calculation to exclude area within inner radius X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=95506ba04bf4cac62699400b2e8b0cee3ca890ef;p=tabakrolletjie.git corrected power usage calculation to exclude area within inner radius --- diff --git a/tabakrolletjie/lights.py b/tabakrolletjie/lights.py index ac6f08e..06f84ba 100644 --- a/tabakrolletjie/lights.py +++ b/tabakrolletjie/lights.py @@ -313,8 +313,9 @@ class BaseLight(object): def power_usage(self): if not self.on: return 0.0 - area = math.pi * (self.ray_manager.max_radius ** 2) # radius - area = area * (self.ray_manager.spread / (2 * math.pi)) # spread + rm = self.ray_manager + area = math.pi * (rm.max_radius ** 2 - rm.min_radius ** 2) # radius + area = area * (rm.spread / (2 * math.pi)) # spread return 5 * area * self.intensity / 6400 # 80x80 unit area def base_damage(self):