Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Downsampling with fixed intervals
Date: Wed, 24 Sep 2008 12:10:04 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 45
Message-ID: <gbdams$9m4$1@fred.mathworks.com>
References: <gbd9hb$9u$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
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 1222258204 9924 172.30.248.37 (24 Sep 2008 12:10:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 24 Sep 2008 12:10:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:491767


"Wolfgang Schwanghart" <schwanghart@googlemail.com> wrote in message <gbd9hb$9u$1@fred.mathworks.com>...
> Dear all,
> 
> I am searching for a function that can perform following:
> 
> I have coastline data where the vertices are unequally spaced. Now I want to sample the data in a way, that may be best described as going with a rod of specified length along the beach and taking a gps measurement at every length of my measuring rod. What I finally want is the list of measured coordinates. What this requires is "of course" an interpolation scheme that may be e.g. linear or spline.
> 
> Does anyone know, if there is a function available, that can perform this. So far I couldn't find anything in the FEX nor in the Matlab Help.


No, you will not find anything that does this
explicitly, although one could write it without
too severe mental anguish.

Assume that you have a curve defined by a
sequence of points in the (x,y) plane. The
curve may be piecewise linear, or it may be
a parametric spline, defined in terms of a
piecewise linear arclength along the curve.

Start at the beginning of the curve. Find the
(first) intersection of your curve and a circle
with center at the start point. Step along
said curve, solving a sequence of root
finding problems along the way.

You might use the intersections tool, written
by Doug Schwarz and on the file exchange.
It will require you to define the initial curve
as a piecewise linear one, and then to
approximate your circle using a piecewise
linear, polygonal approximation to a circle.
But doing so will then be a very fast way to
solve your problem.

The only issue that you must deal with,
regardless of how you choose to solve the
problem, is if the coastline is so tightly
convoluted that these convolutions are
smaller than the length of your ruler. But
in that case, it just means that your ruler
is way too long for this problem.

HTH,
John