[plt-scheme] Nifty assignment help

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Mar 10 18:44:43 EDT 2009

On Mar 10, 2009, at 10:33 AM, Todd O'Bryan wrote:

> The idea is that you create random functions that have domain ([-1,
> 1], [-1, 1]) and range [-1, 1]. You map the domain values to x and y
> and the range values to a color, plot the results, and get very cool
> designs.
>
> What I need are functions with the following contracts:
>
> ;; draw-grayscale: Integer
>    (Integer[0, size] Integer[0, size] -> Integer[0, 255])
>    -> Image
> ;; consumes: the size in pixels of a square image,
> ;;                  a function that, given an x and y coordinate on  
> the image,
> ;;                     produces a grayscale value
> ;; produces: the image

???

> I could do these in the image teachpack using color-list->image, but I
> suspect that would be remarkably slow.

Are you sure? Try first and do report.


> Where should I look for a better way to do it?

Take a look at the plot library. It may be what you want -- Matthias



Posted on the users mailing list.