Home > OS >  How can I show transformation of coordinate grid lines in python?
How can I show transformation of coordinate grid lines in python?

Time:04-05

Suppose I have the regular cartesian coordinate system $(x,y)$ and I consider a rectangular mesh region $D$ (split into little squares). I want to see how the domain D would be mapped under a coordinate transform T:(x,y) -> (u(x,y) ,v(x,y) ) in Python?

I'm looking for something like this:

enter image description here

enter image description here

Adjusting the "how many grid lines" parameters gives us a more precise mesh, eg. here with 25x25 points.

enter image description here

You can also change the get_point function altogether, so as to prove you can plot all sorts of grids...

enter image description here

CodePudding user response:

It's not completely trivial. You need to learn how to use a plotting library to create the plots, e.g. matplotlib. You also need to figure out how to create, discretize and transform your regular grid. The numpy library is very useful for such operations. Anyway, I'm not sure this is such a good problem for a "total beginner". I'd advise to start with something simpler, if you don't know programming or Python at all.

  • Related