A Garmin Connect IQ widget that shows the current Lunar azimuth, elevation, phase, illumination and age.
Use Select to refresh the widget. Use the Menu button to switch between the two display modes.
The azimuth and elevation calculation is based on PHP code by Dubravko Loborec, http://www.dubravkoloborec.com, which was in turn based on the Matlab code by Darin Koblick (See below) (https://www.mathworks.com/matlabcentral/profile/authors/1284781-darin-koblick)
I found many different lunar phase codes & websites which all give slightly different results! Mine is mainly based on mooncalc.c by John Walker (http://www.fourmilab.ch)
Icons made by srip (https://www.flaticon.com/authors/srip) from Flaticon.
Thank you Peter Bleakley and Holger Haug for suggestions and for helping me to test the widget.
Copyright (c) 2010, Darin Koblick All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.