You are reading a single comment by @HilmarSt and its replies.
Click here to read the full conversation.
-
The function to draw a moon phase has been converted into an external module that may be
require
d directly from GitHub
The function to draw a moon phase has been converted into an external module that may be require
d directly from GitHub
Here is an implementation of your moon phase image (based on Bresenham's circle algorithm - yes, I'm able to learn!):
leftFactor
andrightFactor
specify the actual phase that is to be shown:1
for a full moonrightFactor = 1
and start withleftFactor = -1
for a waxing moon. IncreaseleftFactor
until1
for a full moonleftFactor = 1
and start withrightFactor = 1
for a waning moon. DecreaserightFactor
until-1
(see GitHub for the current source code and an animated demo)
Have fun!