LogicMachine Forum
sunrise and sunset values - Printable Version

+- LogicMachine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: sunrise and sunset values (/showthread.php?tid=1010)

Pages: 1 2 3


RE: sunrise and sunset values - Erwin van der Zwart - 07.01.2026

Now changed to this and seems to do the trick as it clamps fo between -1 and 1:

local fo = math.max(math.min(math.tan(declination + dfo) * math.tan(latitude * rads), 1), -1)