User:BenRG/Source code

From Wikimedia Commons, the free media repository
Jump to: navigation, search

This page has the (ugly, hacked together) source code used to generate some of the images I've uploaded to Commons.

Cone fundamentals[edit]

This Perl script produced File:Cone-fundamentals-with-srgb-spectrum.svg. Needs #Svg.pm and #FitCurves.


Friedmann universes[edit]

This Perl script produced File:Friedmann_universes.svg. Needs #Svg.pm and #FitCurves.


CIE1931xy_*.svg[edit]

This Perl script produced File:CIE1931xy_blank.svg, File:CIE1931xy_sRGB.svg, File:CIE1931xy_AdobeRGB.svg, and File:CIE1931xy_CIERGB.svg. Needs #Svg.pm and #FitCurves.


The file chromaticity1.png was produced by this C++ code. It writes a PPM which you'll have to convert to PNG. Note that (to avoid edge artifacts) the script above ended up using a 27×28 image which consists of the 26×28 output of this program with the left column duplicated.


Isotopes and half-life[edit]

This Perl script produced File:Isotopes and half-life.svg. Needs #Svg.pm.


Svg.pm[edit]

The SVG-generating Perl scripts use this. It needs to be in Perl's library search path (or you could set PERL5LIB=.).


FitCurves[edit]

Svg.pm invokes FitCurves, which is a slight modification of a program from Graphics Gems. Download the original here (tar.gz) or here (zip) and then replace DrawBezierCurve and main in FitCurves.c with these functions: