drawmoon.fsp - Frink Server Pages highlighter

[Try drawmoon.fsp]

<%@ contentType="image/png" pageEncoding="raw" %>
<%
use ../sun.frink

g = new graphics
d = parseDate["$date UTC"]

lat  = eval[lat]  degrees
long = eval[long] degrees
g.color[0.7, 0.7, 0.7]   // Draw moon rotation axis
g.add[drawMoonRotationAxisRelativeToZenith[d, lat, long, 0 m, 0, 0, 1]]

g.color[.05,.05,.05]             // Draw dark opaque moon disk
g.fillEllipseCenter[0,0,2,2]

g.color[.8,.8,.8]                // Draw illuminated crescent.
g.add[drawMoonPolygonRelativeToZenith[d,lat,long,0,0,1,true]]
g.writeFormatTransparent["-", "png", 100, 100]
%>

[Try drawmoon.fsp]


Alan Eliasen was born 18353 days, 14 hours, 16 minutes ago.

Back to Frink Server Pages documentation.