Pretty GraphprettyGraph
DescriptionDoing some simple math trickery you can map a standard 2D graph into one that fills the entire 2D plane (i.e. a picture instead of lines). The shape of the objects stays the same provided you are working in the same geometry. So assume you have some function y = f(x) rewrite it as c = f(x) + y and then have some sort of mapping function such that g(c) = (r,g,b) or whatever color scheme you want. This will force the shape to repeat over the plane you are projecting onto, although scaling factors can become an issue. For a simple example y = x is a straight line, transforming this into c = x + y and letting g(c) = (c%255, c*2 %255, c*3 %255) yields the following picture of repeated lines with a 1:1 slope ![]() This works for any such equations, for example a circle x^2 + y^2 = c we get repeated circles Some other examples: ![]() Also from the more complicated original Haskell version: Source Code
Last Edited: 2012-01-22 15:32:33
+ Add a comment 8e0b0c0a939982aaa7ac4cd358e754e82012-02-22 23:19:41.569862 UTC |
Posts
Source Code





