[Date Index]
[Thread Index]
[Author Index]
Re: Color grid with x and y args to visualize effects of 2D transformations?
*To*: mathgroup at smc.vnet.net
*Subject*: [mg116577] Re: Color grid with x and y args to visualize effects of 2D transformations?
*From*: Heike Gramberg <heike.gramberg at gmail.com>
*Date*: Sun, 20 Feb 2011 05:26:54 -0500 (EST)
I'm not entirely sure how you want to use your function, but if you're interested in drawing the image of a rectangular grid after a 2D transformation you could do something like this:
mesh[fx_, fy_, opts___] :=
ParametricPlot[{fx[x, y], fy[x, y]}, {x, 0, 1}, {y, 0, 1},
Mesh -> 9,
MeshShading ->
Table[Hue[xi, (1 - yi), 1], {yi, Range[0, 1, 1/10]}, {xi,
Range[0, 1, 1/10]}], opts]
This would draw the image of the square 0<x,y<1 with a 10x10 coloured grid under the mapping {x,y}->{fx[x,y],fy[x,y]}.
Heike.
On 19 Feb 2011, at 10:15, Christopher O. Young wrote:
> I'm trying to get a simple kind of color chart function that I can pass x
> and as arguments to. I want to have it running across by hue and up by
> saturation and value. This is to illustrate 2D transformations, so I need to
> have arguments that I can _inversely_ transform in order to illustrate the
> effects of 2D transformations, whether linear or not.
>
> One direct approach would seem to have nested loops, but I can't see how to
> do this if the body of the For loop in Mathematica is part of the function.
>
> Any help getting a "jump start" in this kind of thing would be a huge help
> to me.
>
> For[i = 0, i < 10, i++,
>
> For[j = 0, j < 10, j++,
>
> RegionPlot[(i < x < i + 1) && (j < y < j + 1), {x,0,10}, {y,0,10}]
>
> ]
>
> ]
>
> Chris Young
> cy56 at comcast.net
>
>
Prev by Date:
**Re: Another point about Mathematica 8.0**
Next by Date:
**Re: Emacs with Mathematica**
Previous by thread:
**Color grid with x and y args to visualize effects of 2D transformations?**
Next by thread:
**Integral representation of Bessel functions**
| |