From 95506ba04bf4cac62699400b2e8b0cee3ca890ef Mon Sep 17 00:00:00 2001 From: adrianna Date: Fri, 16 Sep 2016 17:34:14 +0200 Subject: [PATCH] corrected power usage calculation to exclude area within inner radius --- tabakrolletjie/lights.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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): -- 2.34.1