jennyMoonVenus.frink

View or download jennyMoonVenus.frink in plain text format


// Analyze picture at:
// http://www.flickr.com/photos/geekmomjenny/6578694459/sizes/o/in/photostream/

// Height of Venus in picture
venusHeight = 34
moonHeight = 175

date = #December 26, 2011 10:00 PM Arizona#

use planets.frink

venusDiameter = 2 Planet.Earth.radiusAngle[date, Planet.Venus]
moonDiameter = 2 moonRadiusAngle[date]

println["Venus diameter is " + (venusDiameter->"arcmin")]
println["Moon diameter is " + (moonDiameter->"arcmin")]

println["Ratio in sky is " + (moonDiameter/venusDiameter)]
println["Ratio in picture is " + (moonHeight/venusHeight)]

g = new graphics
lat = 40 degrees North
long = 105 degrees West

g.add[Planet.Venus.drawPolygonRelativeToZenith[date, lat, long, 0, 0, venusDiameter, false]]
g.add[drawMoonPolygonRelativeToZenith[date, lat, long, .6 degree, 0, moonDiameter, false]]
g.show[]

g.write["venus.svg",800,600]


View or download jennyMoonVenus.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17645 days, 8 hours, 30 minutes ago.