From ffdd24216570c1c756448ebd7d7f74bcab7c775b Mon Sep 17 00:00:00 2001
From: Dan <daniel2.lorych@live.uwe.ac.uk>
Date: Mon, 2 May 2022 20:36:58 +0100
Subject: [PATCH] Fix calculations for PowerOutputs

---
 Helios/Source/BatteryChargeModule.cs | 2 +-
 Helios/Source/SolarPanel.cs          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Helios/Source/BatteryChargeModule.cs b/Helios/Source/BatteryChargeModule.cs
index 198882a..5c89594 100644
--- a/Helios/Source/BatteryChargeModule.cs
+++ b/Helios/Source/BatteryChargeModule.cs
@@ -19,7 +19,7 @@ namespace Helios.Source
         {
             double totalOutput;
 
-            totalOutput = solarPanelEfficiency * solarEnergy * roofArea * this.Efficiency * Math.Sin(sunAngle);
+            totalOutput = solarPanelEfficiency * solarEnergy * roofArea * this.Efficiency * Math.Sin(Math.PI * sunAngle / 180.0);
 
             this.TotalOutput = totalOutput;
 
diff --git a/Helios/Source/SolarPanel.cs b/Helios/Source/SolarPanel.cs
index 0e8e59d..4dcb9ad 100644
--- a/Helios/Source/SolarPanel.cs
+++ b/Helios/Source/SolarPanel.cs
@@ -36,7 +36,7 @@ namespace Helios.Source
         {
             double powerOutput;
 
-            powerOutput = Efficiency * solarEnergy * roofArea * Math.Sin(roofElevation);
+            powerOutput = Efficiency * solarEnergy * roofArea * Math.Sin(Math.PI * roofElevation / 180.0);
 
             this.PowerOutput = powerOutput;
 
-- 
GitLab