Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!r40g2000yqj.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: River miles
Date: Wed, 19 Nov 2008 13:40:59 -0800 (PST)
Organization: http://groups.google.com
Lines: 103
Message-ID: <01d3cdd8-c83e-47bc-9357-fb97949f0eff@r40g2000yqj.googlegroups.com>
References: <gfst52$caq$1@fred.mathworks.com> <90f017a9-906d-4c7d-8ac5-7167e15e0d8c@u18g2000pro.googlegroups.com> 
	<f36d9204-1e90-4b53-b6f2-6d1b6ecb1f4b@i18g2000prf.googlegroups.com> 
	<gg1tmp$elq$1@fred.mathworks.com>
NNTP-Posting-Host: 77.17.109.140
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1227130860 5180 127.0.0.1 (19 Nov 2008 21:41:00 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 19 Nov 2008 21:41:00 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: r40g2000yqj.googlegroups.com; posting-host=77.17.109.140; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
	CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:501851


On 19 Nov, 21:42, "Travis" <sinuso...@hotmail.com> wrote:
> Rune Allnor <all...@tele.ntnu.no> wrote in message <f36d9204-1e90-4b53-b6=
f2-6d1b6ecb1...@i18g2000prf.googlegroups.com>...
> > On 18 Nov, 16:13, "Travis" <sinuso...@hotmail.com> wrote:
> > > Rune Allnor <all...@tele.ntnu.no> wrote in message <6875d2af-8eb2-443=
a-a8=3D
> > 31-d4c1773c1...@c36g2000prc.googlegroups.com>...
>
> > > =3DA0Rune the river was mapped using a GPS that recorded time, posiio=
n, and=3D
> > =A0heading each time the heading changed. =3DA0It was then interpolated=
 so that=3D
> > =A0data taken between heading chages have unique lat/long values. =3DA0=
Are you =3D
> > suggesting that I break the river up into segments that do not double b=
ack =3D
> > on themselves
>
> > Yes. Use the segments between consecutive (lat,long) points
> > as basis.
>
> > > and use interp1 on each segment?
>
> > No. Interpolate the whole curve.
>
> > >=3DA0I have a 60 mile stretch of river to do this for. =3DA0
>
> > No need to do that manually. The idea is to sort
> > the data not according to lat or long, but according
> > to travelled/accumulated distance.
>
> > The distance serves as a parameter, and so the
> > (lat, long) path becomes an arbitrary parametric
> > curve in the plane. Once you see this basic idea
> > the rest is (almost) trivial.
>
> > Rune
>
> What coding would I use in this instance?=96 Skjul sitert tekst =96
>
> =96 Vis sitert tekst =96

Don't know what you mean by coding, but here's an example:

%   lat        long     dist
d =3D[0.0081    0.9128         0
    0.1340    0.9210    0.9307
    0.2437    0.9485    1.9100
    0.3660    0.9609    2.9382
    0.5027    0.9581    4.0202
    0.5836    0.9375    5.1245
    0.6106    0.9114    6.2216
    0.6178    0.8592    7.2798
    0.5567    0.7837    8.2410
    0.4344    0.7658    9.1215
    0.2671    0.7782    9.9442
    0.1736    0.7919   10.7549
    0.0872    0.7617   11.5215
    0.0854    0.6985   12.2252
    0.1178    0.6738   12.9092
    0.3300    0.6078   13.6008
    0.4308    0.6147   14.3514
    0.6106    0.6490   15.2426
    0.7383    0.6834   16.2486
    0.8714    0.7012   17.3671
    0.9379    0.6463   18.5062
    0.9397    0.5968   19.6194
    0.9074    0.5391   20.6749
    0.8444    0.5364   21.6753
    0.7167    0.5474   22.5771
    0.5800    0.5776   23.3957
    0.4829    0.5254   24.1093
    0.3804    0.4512   24.6995
    0.3768    0.4045   25.2524
    0.4272    0.3674   25.8158
    0.5495    0.3633   26.4745
    0.6214    0.3743   27.2000
    0.7581    0.3565   28.0377
    0.7923    0.3207   28.8924
    0.7815    0.2507   29.7131
    0.7131    0.1655   30.4452
    0.5585    0.1669   31.0281
    0.4937    0.1875   31.5562
    0.3678    0.2026   31.9761
    0.2653    0.1806   32.2970
    0.2149    0.1133   32.5400
    0.2941    0.0680   32.8418
    0.4200    0.0694   33.2675
    0.5387    0.0556   33.8090];

% Plot the river path
subplot(2,1,1)
plot(d(:,1),d(:,2))

% Plot the lat and long vs distance
subplot(2,1,2)
plot(d(:,3),d(:,1),'b',d(:,3),d(:,2),'r')

Now you can interpolate both lats and longs with
respect to distance, and maybe be able to go on
from there.

Rune