http://roadtolarissa.com/triangles
Only a couple of lines of codes too:
https://github.com/1wheel/BizarreSierpinskiTriangle/blob/mas...
11–20 of 61 posts
http://roadtolarissa.com/triangles
Only a couple of lines of codes too:
https://github.com/1wheel/BizarreSierpinskiTriangle/blob/mas...
A few years ago, I accidentally found this way of creating a Sierpinski Gasket-like structure: https://vimeo.com/7690310 Lines "flow" from left to right (horizontally) or bottom to top (vertically), and all lines start out white. When two lines cross, they might switch color depending on which color they come across, as follows: * white (h) + white (v) = black (h) + black (v) * black (h) + black (v) = black (h) + bla…
Is is just me or is the code source really hard to understand? It's cool that you can represent such complex shapes with just a few lines of code in Mathmatica, but without comments and with all the single letter variables, it's hard for me to follow what's going on.
Code by/for mathematicians is particularly ugly to a professional programmer. There is significant historical (pencil & paper) precedent for what single-letter variables represent in a given context. For a mathematician, ConstantArray[0, {m,n}] reads more cleanly than ConstantArray[0, {cols,rows}].
Similarly, seeing variables like p1, p2, p3 is off-putting to me as a programmer, but I still immediately recognize them as 3 arbitrary points in a triangle.
That's amazing. It just goes on and on with beautiful plots. About halfway down, there's a section on understanding the Riemann sphere: > From what I can tell, one of the settings used to deal with division by 0 is the so-called Riemann sphere, which is where we take a space shuttle and use it to fly over and drop a cow on top of a biodome, and then have the cow indiscriminately fire laser beams at the grass inside a…
The Riemann sphere lets you deal with dividing by 0 by adding one more point to the complex plane: ∞[1]. Imagine putting it in the air above the origin, 0, and folding the midpoints of the four sides of your graph paper to meet there. (Yup, put all 4 points of the arrows in the same spot!) That's the Reimann sphere[2].
Going from a point the sphere back to the plane is a little weird.
1. Put a cow (point) on the top of the biodome (sphere) at infinity.
2. Pick the point on the sphere that you want to give a home on the complex plane.
3. Have the cow fire a laser beam (draw a line from infinity) through the point.
4. Follow that line back to wherever it hits the plane. That's the equivalent point on your complex plane.
Play with this a bit. Points near the top of the sphere (near the cow, at infinity) will shoot laser beams way off into the distance. Points near the bottom of the sphere will burn the grass right nearby on the plane itself.
You can then reverse the process ("If my cow were to shoot a laser at this grass, what part of the the biodome will get hit?"), to go from the plane to the sphere, because "folding up the sides of paper" doesn't accurately model what happened to make the sphere.
[1] Math with ∞ is what you'd expect: 3/0 = ∞. 3/∞ = 0.
[2] Since there is an infinite number of points on a sphere, this is entirely possible, and only mildly unsettling.
Is is just me or is the code source really hard to understand? It's cool that you can represent such complex shapes with just a few lines of code in Mathmatica, but without comments and with all the single letter variables, it's hard for me to follow what's going on.
I agree, but do realize this is written for a mathematical audience, not a CS audience. It's reductive, but it's not that reductive to your average math major/grad student. Code by/for mathematicians is particularly ugly to a professional programmer. There is significant historical (pencil & paper) precedent for what single-letter variables represent in a given context. For a mathematician, ConstantArray[0, {m,n}] re…
Not nearly as comprehensive, but interactive w/ d3: http://roadtolarissa.com/triangles Only a couple of lines of codes too: https://github.com/1wheel/BizarreSierpinskiTriangle/blob/mas...