Oblique MeshGrid Selection

Discussion in 'MATLAB' started by John S Megu, Jun 18, 2006.

  1. John S Megu

    John S Megu Guest

    Hello Matlab Users,

    Wondering whether it is possible to select "meshgrid"
    using an oblique area selection ( I mean not rectangle
    or square, but a parellogram or any quadrilateral shape
    of area). Here X & Y coordinates with oblique end points
    and z coordinate vertical.

    THANKS IN ADVANCE

    JOHN
     
    John S Megu, Jun 18, 2006
    #1
    1. Advertisements

  2. Simplest is to transform the grid to
    achieve what you want.

    For example, start with a simple
    meshgrid, then transform the domain
    to some non-rectangular one with a
    linear transformation.

    For example,

    [x,y] = meshgrid(0:.1:1);

    u = x + y;
    v = 2*x - y;

    plot(x,y,'ro',u,v,'b+')

    Or,

    u = x;
    v = x+y;

    plot(x,y,'ro',u,v,'b+')

    Note that a linear transformtion
    (an affine transformation) will allow
    you to rotate, translate, shear, or
    stretch the original grid, or any
    combination of those effects. If you
    write the points (x,y) as a column
    vector, then an affine transformation
    can be represented as

    U = A*X + b

    where b is the translation vector.
    Here are a couple of good references.

    <http://en.wikipedia.org/wiki/Affine_transformation>

    <http://mathworld.wolfram.com/AffineTransformation.html>

    However, an affine transformation will
    not transform the square domain from
    meshgrid into any general quadrilateral.
    You will need a slightly more sophisticated
    transformation to do that.

    A projective transformation should do
    what you are looking for. It can be
    represented as a bilinear form.

    <http://en.wikipedia.org/wiki/Projective_transformation>

    <http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/EPSRC_SSAZ/node7.html>

    HTH,
    John D'Erricc
     
    John D'Errico, Jun 18, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.