The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Navigating in a rotated grid?
Replies: 3   Last Post: Nov 17, 2010 7:03 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 49
Registered: 8/4/08
Re: Navigating in a rotated grid?
Posted: Nov 17, 2010 7:03 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> Well, the rotation matrix above seems like the way to go.
> Why is this not a "nice" result?
> Can you provide an example?
> Can you use interp1 (or one of its variations)
> to get your "even" spacing?

> > /JS


Thanks for your reply!

Yes, for now I have had to resort to rotating the grid to be "upright"
and interpolate the rotated grid onto a perfect (even-spaced) one with
GRIDDATA. Given the small discrepancies, this interpolation does not
change much, so it is acceptable for now.

An example would be this. Imagine a grid with unit spacing, rotated 10
degrees clockwise thus forming a diamond with the lower left corner
set in (0,0). If I position myself in this left corner (0,0) and I
wish to move to the next point along the lower edge of the grid (to
read off the Z coordinate associated with that point), which in the
"upright" version of the grid would be (1,0), how do I find that point
easily in the rotated grid? Since I know the spacing to be 1, and the
angle to be 10 degrees, I can of course predict the coordinates where
the point should be in the "upright" system and then look for it in
the list. But this just appears to be a clumsy solution. This is the
same as rotating the the entire grid up and handling the uneven
coordinates with some rounding scheme.

But I have now thought about it for a while and I guess there is no
"correct", elegant way of doing this, that is, defining my own
coordinate system, with axes parallel to the grid's edges.

Thanks for looking!


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.