Matlab functions    from  BioméCardio    

 
   smoothn
cumsimps   

clinspace

Curvilinearly spaced points on a parametric curve

Contents

Download

clinspace.m

Syntax

   [xi,yi] = clinspace(x,y)
   [xi,yi] = clinspace(x,y,n)
   [xi,yi,zi] = clinspace(x,y,z)
   [xi,yi,zi] = clinspace(x,y,z,n)

Description

[xi,xi] = clinspace(x,y,n) generates n equally curvilinearly spaced points interpolating the curve represented by the series (x,y).

[xi,yi,zi] = clinspace(x,y,z,n) generates n equally curvilinearly spaced points interpolating the curve represented by the series (x,y,z).

If n is omitted, 100 points are generated.

Note: The function cumsimps.m is required (download it).

Examples

Create 10 equally spaced points on the parametric curve represented by (x,y).

x = 0:0.01:10;
y = 5*sin(x.^3/100).^2;
[xi,yi] = clinspace(x,y,10);
plot(x,y,xi,yi,'o')
axis equal

Create 10 equally spaced points on a 3D curve.

x = -2*pi:0.01:2*pi;
y = 10*sin(x);
z = linspace(0,10,length(x)).^1.5;
[xi,yi,zi] = clinspace(x,y,z,10);
plot3(x,y,z,xi,yi,zi,'o')
box on, axis equal

See also

linspace

About the author

Damien Garcia, Eng., Ph.D.
Assistant professor, Department of radiology
CRCHUM, University of Montreal Hospital
Montreal, QC, Canada
Damien.Garcia.REMOVE-THIS@BiomeCardio.com

www.biomecardio.com