A common request is to interpolate a set of points at fixed distances along some curve in space (2 or more dimensions.) The user typically has a set of points along a curve, some of which are closely spaced, others not so close, and they wish to create a new set which is uniformly spaced along the same curve.
When the interpolation is assumed to be piecewise linear, this is easy. However, if the curve is to be a spline, perhaps interpolated as a function of chordal arclength between the points, this gets a bit more difficult. A nice trick is to formulate the problem in terms of differential equations that describe the path along the curve. Then the interpolation can be done using an ODE solver.
As an example of use, I'll pick a random set of points around a circle in the plane, then generate a new set of points that are equally spaced in terms of arc length along the curve, so around the perimeter of the circle.
Interpolation 3D Polyline Welcome to video tutorial on Interpolation using 3D Line. In this video you will learn how to interpolate values using 3D line using ESurvey Interpolate module. Create Points - Interpolate - Along Polyline/Curve Summary: When doing prepping points for construction stakeouts it would be great to interpolate points along a curve or Polyline. This would save me from having to create points by interpolation, then moving these points to the curve. Out of the 4 input points, it will interpolate only the mid points. Moving the end junctions along the shadowed line keeps. Creates a new path item from SVG path-data. Turning the path into a polygon (or a polyline if it. With ArcGIS 10 (not sure about earlier versions) Linear Referencing Routes that have XYZM values will interpolate Z at any point along the line. The Create Route tool should preserve the Z values of the original points and add M values based on the 2D length of the line.
theta = sort(rand(15,1))*2*pi;
theta(end+1) = theta(1);
px = cos(theta);
py = sin(theta);
100 equally spaced points, using a spline interpolant.
theta(end+1) = theta(1);
px = cos(theta);
py = sin(theta);
100 equally spaced points, using a spline interpolant.
pt = interparc(100,px,py,'spline');
% Plot the result
plot(px,py,'r*',pt(:,1),pt(:,2),'b-o')
axis([-1.1 1.1 -1.1 1.1])
axis equal
grid on
xlabel X
ylabel Y
title 'Points in blue are uniform in arclength around the circle'
plot(px,py,'r*',pt(:,1),pt(:,2),'b-o')
axis([-1.1 1.1 -1.1 1.1])
axis equal
grid on
xlabel X
ylabel Y
title 'Points in blue are uniform in arclength around the circle'
You can now also return a function handle to evaluate the curve itself at any point. As well, CSAPE is an option for periodic (closed) curves, as long as it is available in your matlab installation.
How To Interpolate Between Two Numbers
[~,~,foft] = interparc([],px,py,'spline');
foft(0:0.25:1)
ans =
0.98319 0.18257
-0.19064 0.98151
-0.98493 -0.17486
0.18634 -0.98406
0.98319 0.18257
foft(0:0.25:1)
ans =
0.98319 0.18257
-0.19064 0.98151
-0.98493 -0.17486
0.18634 -0.98406
0.98319 0.18257