Skip to content

Instantly share code, notes, and snippets.

@quephird
Last active December 16, 2015 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save quephird/5374286 to your computer and use it in GitHub Desktop.
Save quephird/5374286 to your computer and use it in GitHub Desktop.
This is a super hacky program to generate a picture that I hope will resemble the one here: http://felifee.deviantart.com/art/fire-blossom-364662404. I'm not too familiar with Maxima, so I'm just slapping stuff together until I better understand how the "language" works until I attempt to refactor this code.
load(draw);
draw_polar(expr,range) :=
block([theta_var: range[1]],
draw2d(background_color = black,
xtics = 'none,
ytics = 'none,
axis_top = false,
axis_bottom = false,
axis_left = false,
axis_right = false,
xrange = [-3,3],
yrange = [-3,3],
nticks = 1000,
dimensions = [1000,1000],
terminal = png,
file_name = "fire-blossom",
line_width = 10,
color = "#95A161",
parametric(cos(theta_var)*(expr), sin(theta_var)*(expr), theta_var,range[2],range[3]),
color = "#DCFBCF",
parametric(cos(theta_var)*(expr-0.2), sin(theta_var)*(expr-0.2), theta_var,range[2],range[3]),
color = "#D3AF10",
parametric(cos(theta_var)*(expr-0.4), sin(theta_var)*(expr-0.4), theta_var,range[2],range[3]),
color = "#8A0F00",
parametric(cos(theta_var)*(expr-0.6), sin(theta_var)*(expr-0.6), theta_var,range[2],range[3]),
color = "#801004",
parametric(cos(theta_var)*(expr-0.8), sin(theta_var)*(expr-0.8), theta_var,range[2],range[3]),
color = "#260000",
parametric(cos(theta_var)*(expr-1), sin(theta_var)*(expr-1), theta_var,range[2],range[3]),
color = "#95A161",
parametric(cos(theta_var)*(expr-1.2), sin(theta_var)*(expr-1.2), theta_var,range[2],range[3]),
color = "#DCFBCF",
parametric(cos(theta_var)*(expr-1.4), sin(theta_var)*(expr-1.4), theta_var,range[2],range[3]),
color = "#D3AF10",
parametric(cos(theta_var)*(expr-1.6), sin(theta_var)*(expr-1.6), theta_var,range[2],range[3]),
color = "#8A0F00",
parametric(cos(theta_var)*(expr-1.8), sin(theta_var)*(expr-1.8), theta_var,range[2],range[3]),
color = "#801004",
parametric(cos(theta_var)*(expr-2), sin(theta_var)*(expr-2), theta_var,range[2],range[3]),
color = "#260000",
parametric(cos(theta_var)*(expr-2.2), sin(theta_var)*(expr-2.2), theta_var,range[2],range[3])
));
draw_polar(3 + sin(5*t)/2 + sin(50*t)/5, [t,0,2*%pi]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment