0708-1300/Class notes for Tuesday, September 11

From Drorbn
Revision as of 18:55, 10 September 2007 by Drorbn (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Announcements go here

In Small Scales, Everything's Linear

06-240-QuiltBeforeMap.png 06-240-QuiltAfterMap.png

Code in Mathematica:

QuiltPlot[{f_,g_}, {x_, xmin_, xmax_, nx_}, {y_, ymin_, ymax_, ny_}] :=
Module[
  {dx, dy, grid, ix, iy},
  SeedRandom[1];
  dx=(xmax-xmin)/nx;
  dy=(ymax-ymin)/ny;
  grid = Table[
    {x -> xmin+ix*dx, y -> ymin+iy*dy},
    {ix, 0, nx}, {iy, 0, ny}
  ];
  grid = Map[({f, g} /. #)&, grid, {2}];
  Show[
    Graphics[Table[
      {
        RGBColor[Random[], Random[], Random[]],
        Polygon[{
          grid[[ix, iy]],
          grid[[ix+1, iy]],
          grid[[ix+1, iy+1]],
          grid[[ix, iy+1]]
        }]
      },
      {ix, nx}, {iy, ny}
    ]],
    Frame -> True
  ]
]

QuiltPlot[{x, y}, {x, -10, 10, 8}, {y, 5, 10, 8}]
QuiltPlot[{x^2-y^2, 2*x*y}, {x, -10, 10, 8}, {y, 5, 10, 8}]

See also 06-240/Linear Algebra - Why We Care.

Class Notes