Christmas cards with code and maths

December 13th, 2015 | Categories: general math, just for fun, math software, programming | Tags:

Way back in 2008, I wrote a few blog posts about using mathematical software to generate christmas cards:

I’ve started moving the code from these to a github repository. If you’ve never contributed to an open source project before and want some practice using git or github, feel free to write some code for a christmas message along similar lines and submit a Pull Request.

  1. Samir
    December 18th, 2015 at 19:32
    Reply | Quote | #1

    Try this in Maple (via http://www.maplesoft.com/applications/view.aspx?SID=153935)

    n := 18532529104068264480353131238404133659515101876112780772576330806424607039523076495646885634139967048751461005248758632306757568791464282975763655513845614593843019187655175699232981800640177552230121901623724542589154403221854439086181827152684585874764890938291566599716051702867105827305295569713835061785617174899049034655848488352249531058730460687733248824488684969031964141214711866905054239875930383262767247976845232997188307342087743859641917976242185446451606034726912968063437466250120212904972794971185874579656679344857677824:
    modnew := proc (x, y) options operator, arrow; x-y*floor(x/y) end proc:
    tupper := piecewise(1/2 < floor(modnew(floor((1/17)*y)*2^(-17*floor(x)-modnew(floor(y), 17)), 2)), 0, 1):
    points := [seq([seq(tupper(x, y), y = n+16 .. n, -1)], x = 105 .. 0, -1)]:
    plots:-listdensityplot(points, scaling = constrained, view = [0 .. 106, 0 .. 17], style = patchnogrid, size = [800, 800]);

  2. Mike Croucher
    December 23rd, 2015 at 14:25
    Reply | Quote | #2

    Nice! Thank you.
    Worth a blogpost of its own I think http://www.walkingrandomly.com/?p=5924