--- /usr/lib/drive-qml/models/MapSettingsModel.qml.orig
+++ /usr/lib/drive-qml/models/MapSettingsModel.qml
@@ -135,8 +135,8 @@
var lat_rad = pos.latitude * (Math.PI/180);
var declination = (23.4*Math.PI)/180 * Math.sin(2*Math.PI * (284+dayOfTheYear)/365);
var omega = Math.acos(-Math.tan(declination) * Math.tan(lat_rad));
- var sunset = 12 - (1/15) * omega * (180/Math.PI) - pos.longitude/15 + today.getTimezoneOffset()/60;
- var sunrise = 24 - sunset; //(1/15) * omega * (180/Math.PI) - pos.longitude/15 + today.getTimezoneOffset()/60;
+ var sunset = 12 + (1/15) * omega * (180/Math.PI) - pos.longitude/15 - today.getTimezoneOffset()/60;
+ var sunrise = 12 - (1/15) * omega * (180/Math.PI) - pos.longitude/15 - today.getTimezoneOffset()/60;
console.log("Sunset:" + sunset);
console.log("Sunrise:" + sunrise);
| The Following 8 Users Say Thank You to mbanck For This Useful Post: | ||
--- /usr/lib/drive-qml/models/MapSettingsModel.qml.orig
+++ /usr/lib/drive-qml/models/MapSettingsModel.qml
@@ -135,8 +135,8 @@
var lat_rad = pos.latitude * (Math.PI/180);
var declination = (23.4*Math.PI)/180 * Math.sin(2*Math.PI * (284+dayOfTheYear)/365);
var omega = Math.acos(-Math.tan(declination) * Math.tan(lat_rad));
- var sunset = 12 - (1/15) * omega * (180/Math.PI) - pos.longitude/15 + today.getTimezoneOffset()/60;
- var sunrise = 24 - sunset; //(1/15) * omega * (180/Math.PI) - pos.longitude/15 + today.getTimezoneOffset()/60;
+ var sunset = 12 + (1/15) * omega * (180/Math.PI) - pos.longitude/15 - today.getTimezoneOffset()/60;
+ var sunrise = 12 - (1/15) * omega * (180/Math.PI) - pos.longitude/15 - today.getTimezoneOffset()/60;
console.log("Sunset:" + sunset);
console.log("Sunrise:" + sunrise);
| The Following 2 Users Say Thank You to For This Useful Post: | ||
| The Following 2 Users Say Thank You to 3sigma For This Useful Post: | ||
| The Following 9 Users Say Thank You to nailwood For This Useful Post: | ||
| The Following User Says Thank You to MaikEF For This Useful Post: | ||