Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Image rotation and NaNs...
Date: Sat, 6 Jun 2009 17:31:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <h0e94l$h1a$1@fred.mathworks.com>
References: <gvivk5$q0m$1@fred.mathworks.com> <h0dehc$8ui$1@fred.mathworks.com> <h0dgsc$5jr$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1244309461 17450 172.30.248.37 (6 Jun 2009 17:31:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 6 Jun 2009 17:31:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1693326
Xref: news.mathworks.com comp.soft-sys.matlab:545231


> well, yes: your results comply exactly with the rule...
> 
>      help interp2;
> %{
> % note: EXTRAPVAL
> ...
>     ZI = INTERP2(...,METHOD,EXTRAPVAL) specificies a method and a scalar 
>     value for ZI outside of the domain created by X and Y.  Thus, ZI will
>     equal EXTRAPVAL for any value of YI or XI which is not spanned by Y 
>     or X respectively. A method must be specified for EXTRAPVAL to be used,
>     the default method is 'linear'.
> ...
> %}
> % eg,
>      X=magic(3);
>      [M N]=size(X);
>      [n m]=meshgrid(-N/2:N/2-1,-M/2:M/2-1);
>      np=n*cos(2*pi)-m*sin(2*pi);
>      mp=n*sin(2*pi)+m*cos(2*pi);
>      y=interp2(n,m,X,np,mp,'linear');
> % look at
>      [n;nan(1,size(n,1));np]     % <- nan: separator...
> % -or-
>      [m;nan(1,size(m,1));mp]
> 
> us

Mmmm...maybe I'm a little dumb today but I can't understand what you just said,could you be more clear please?
I know how interp2 works,but I can't explain why if I make a 360? rotation I can't return with the original values...