## Create colorful images by slightly modifying standard graphing techniques |

### Description

Doing 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

**x^2 + y^2 = c**we get repeated circles

Also from the more complicated original Haskell version:

## No comments:

Post a Comment